Page 1 of 1

Problem passing variable to FB file in Win7

Posted: Mon May 10, 2010 11:58 pm
by dbish
I recently had to replace my aging XP machine with a Win7 64 bit box. Freebasic still works fine but I discovered a strange error.

I use a batch file to get user input (a file date), decompress a zipped data file for that date and then call a freebasic executable to do the processing. I am trying to pass the input 20100507 to both the process in the batch file as well as the FB program.

Batch file snippet:
set /p FILEDATE=Enter IndexDate of manual file (YYYYMMDD):
rem to test what is input - works correctly echo ___%FILEDATE%
rem to test what is input - works correctly Pause
pkzipc -extract c:\OptData\Daily\
c:\OptData\Develop\Option~1.exe %FILEDATE%

Now the FB code:
FILENAMECURRENT$ = "c:\OptData\Daily\"+CL$+".csv"

For some reason the FB program is now adding an extra space. My two Print lines are to debug. The first line (Print CL$) returns a null variable (output is CL$=)
The FILENAMECURRENT$ variable returns:
c:\OptData\Daily\ 20100507.csv

Note the odd space right before the passed variable is joined into the file location variable.

1. Has anybody else experienced this sort of odd behavior in Win7. The programs worked fine in XP.
2. Any ideas on why or if the program is likely to be consistently bad in this area (if so I can find some micky mouse way around it).


Posted: Tue May 11, 2010 12:01 am
by dbish
Actually, I just ran it again and the debug statement (first in FB portion of post) came back $CL= 20100507 so the extra space is showing up in the original pass.