Config env mod_harbour

57 views
Skip to first unread message

itama...@gmail.com

unread,
Nov 27, 2024, 7:59:32 PM11/27/24
to ModHarbour
Hi!
How to I config VARIABLES of samples mod_harbour. ?

Error: Create error

filename: /var/www/html/modharbour_samples/samples/chat/chat.dbf
called from: DBCREATE, line: 0
called from: pcode.hrb, MAIN, line: 7
called from: HB_HRBDO, line: 0
called from: ../source/exec.prg, EXECUTE, line: 70

Source:
0005:
0006:
0007 =>      DbCreate( hb_GetEnv( "PRGPATH" ) + "/chat.dbf", { { "TIME",        "C",  8, 0 }, { "USERID",      "C", 15, 0 }, { "MSG",         "M", 10, 0 } } )
0008:    endif
0009:

Best regards,
Itamar M. Lins Jr.

Wen Sheng

unread,
Nov 28, 2024, 12:21:28 AM11/28/24
to ModHarbour
use hb_getEnv('PRGPATH') is error!!
You can use: cPrgFile  := AP_FileName() go get full path and filename
cPathDir  := cFilePath(cPrgFile) // This is current

You used the wrong function:  hb_getEnv('PRGPATH')
The correct method should be to use: cPrgFile := AP_Filename()
Then use: cDir := cFilePath(cPrgFile) to get the path name.

dbCreate( cDir+'/chat.dbf', {{....},{....}} )


itama...@gmail.com 在 2024年11月28日 星期四上午8:59:32 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages