Page 1 of 1

Re: How does mod harbour work

Posted: Mon Jan 15, 2024 9:19 am
by Ruth
Dear friends,

I use

Code: Select all | Expand

ENDTEXT
? "test1"
? "test2"
TEMPLATE
 
which works fine...

but would prefer something like this in some situations...

Code: Select all | Expand

<?prg
? "test3"
?>
do I need to escape the "?" in this context, because the code-example doesnt seem to work.

what is working

Code: Select all | Expand

<?prg
return "test4"
?>
but not multiline

Code: Select all | Expand

<?prg
return "test4"
return "test5"
?>
Thank you a lot in advance and kind regards
Ruth

Re: How does mod harbour work

Posted: Mon Jan 15, 2024 9:35 am
by Ruth
Dear team,


I kindly want to ask another question about "How does mod harbour work".
On some occasions I get very useful error messages - like for example
Error: LOCAL declaration follows executable statement
operation: line:593
called from: HB_COMPILEFROMBUF, line: 0
called from: ..\source\exec.prg, EXECUTE, line: 68

Source:
0066: cPRGPATH := hb_GetEnv( "PRGPATH" )
0067: cPRGPATH := STRTRAN( cPRGPATH , "/", "\" )
0068 =>cdbf_BLOG := cPRGPATH+ "\data\BLOG.DBF"
0069: lRecord := .T.
0070:
but I make a lot of other mistakes too, where I don´t "see" the error right away ... like for example trying to return a numeric value

Code: Select all | Expand

<?prg return hWarenkorb["Variante2"]["Zimmer1"]["Subtotal"] ?>
could I set up some error messages somewhere for my common mistakes? so that the programm "tells" me "Error: STR() missing for numeric value..."


thanks again for your attention and kind regards
ruth

Re: How does mod harbour work

Posted: Mon Jan 15, 2024 12:33 pm
by Antonio Linares
Ruth wrote:Dear friends,

I use

Code: Select all | Expand

ENDTEXT
? "test1"
? "test2"
TEMPLATE
 
which works fine...

but would prefer something like this in some situations...

Code: Select all | Expand

<?prg
? "test3"
?>
do I need to escape the "?" in this context, because the code-example doesnt seem to work.

what is working

Code: Select all | Expand

<?prg
return "test4"
?>
but not multiline

Code: Select all | Expand

<?prg
return "test4"
return "test5"
?>
Thank you a lot in advance and kind regards
Ruth
Dear Ruth,

Instead of doing:

Code: Select all | Expand

<?prg
? "test3"
?>
use:

Code: Select all | Expand

<?prg
AP_RPUTS( "test3" )
?>

Re: How does mod harbour work

Posted: Mon Jan 15, 2024 12:38 pm
by Antonio Linares
Ruth wrote:Dear team,


I kindly want to ask another question about "How does mod harbour work".
On some occasions I get very useful error messages - like for example
Error: LOCAL declaration follows executable statement
operation: line:593
called from: HB_COMPILEFROMBUF, line: 0
called from: ..\source\exec.prg, EXECUTE, line: 68

Source:
0066: cPRGPATH := hb_GetEnv( "PRGPATH" )
0067: cPRGPATH := STRTRAN( cPRGPATH , "/", "\" )
0068 =>cdbf_BLOG := cPRGPATH+ "\data\BLOG.DBF"
0069: lRecord := .T.
0070:
but I make a lot of other mistakes too, where I don´t "see" the error right away ... like for example trying to return a numeric value

Code: Select all | Expand

<?prg return hWarenkorb["Variante2"]["Zimmer1"]["Subtotal"] ?>
could I set up some error messages somewhere for my common mistakes? so that the programm "tells" me "Error: STR() missing for numeric value..."


thanks again for your attention and kind regards
ruth
Dear Ruth,

mod_harbour errors handling sometimes is not very usefull, I agree with you.

Re: How does mod harbour work

Posted: Mon Jan 15, 2024 12:59 pm
by Ruth
dear antonio, thank you very much for your answers and your kind help. kind regards and have a nice day ruth