Problem passing variable to FB file in Win7

The forum for all of your Freebasic needs!

Moderators: Pete, Mods

dbish
Coder
Posts: 19
Joined: Tue Apr 12, 2005 7:37 pm

Problem passing variable to FB file in Win7

Postby dbish » Mon May 10, 2010 11:58 pm

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\%FILEDATE%.zip
c:\OptData\Develop\Option~1.exe %FILEDATE%

Now the FB code:
CLS
CL$=COMMAND$
PRINT "CL$=";CL$
FILENAMECURRENT$ = "c:\OptData\Daily\"+CL$+".csv"
PRINT "___";FILENAMECURRENT$

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.

Questions:
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).

Thanks

dbish
Coder
Posts: 19
Joined: Tue Apr 12, 2005 7:37 pm

Postby dbish » Tue May 11, 2010 12:01 am

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.


Return to “Freebasic Questions & Answers”

Who is online

Users browsing this forum: No registered users and 1 guest