|
Post by rikky on Feb 13, 2021 0:00:19 GMT 1
Hello Im using the latest FOSSIL And this time I cannot lay the finger on what is exactly going wrong. so the shortest program that crashes is included here below. Mind that removing the OPTION EXPLICIT causes the program to compile and run properly. Also the latest stable version 4.3.1 works correctly. basename$ = BASENAME$(TOKEN$(ARGUMENT$,1))
OPTION EXPLICIT TRUE
DECLARE ARGUMENTS$ ASSOC STRING
ALIAS argv TO ARGS$ ALIAS argc TO ARGLEN DEF FN ARGC() = argc DEF FN ARGPARSE$(klm) = IIF$(ARGC(), ARGS$[klm], "")
SUB SELECT_ARGUMENTS$(ARGS$[],arglen)
LOCAL i LOCAL bla$ LOCAL counter = 0 FOR i = 1 TO arglen-1 bla$ = ARGS$[i] SELECT bla$ CASE "--help" PRINT "HELP" END 0 DEFAULT INCR counter ARGUMENTS$(STR$(counter)) = bla$ END SELECT NEXT i END SUB
SELECT_ARGUMENTS$(ARGS$,ARGLEN)
PRINT ARGUMENTS$("1") result : Syntax error: OPTION EXPLICIT forces explicit variable declaration at line 32 in file 'test.bac'! Rik P.S: The clocks work nice
|
|
|
Post by Pjot on Feb 13, 2021 9:07:02 GMT 1
Hi rikky, Your code is fine, it is a beta feature The beta consists an internal code reorganization which save more than 100 lines of code. The internal verification was improved so the check for OPTION EXPLICIT now should work better. BR Peter
|
|