rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 8, 2018 16:56:47 GMT
Using the same platform as in INI file error just posted:
From a DOS window and a full token environment it pops an "Application Load Aborted" error box with
text containing:
"File not found: Search.TKN OK".
But the TKN File is in the same folder as the .EXE
In this area is all 8 V*.SLL or V*.DLL files, Search.EXE (V2 source) and Search.TKN (V2 source)
DOS Command used is:
.\search e:\photos\t240test sylvan scene Exact
\s\Rick
|
|
|
Post by Rod on Nov 9, 2018 13:19:25 GMT
When a runtime kicks off it looks for the .tkn in the current working directory. Not sure what .\ means but if that is calling the search runtime from another directory it wont work. You would need to set the working directory to the directory your files are saved to.
So explain the dos command a bit more.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 9, 2018 15:39:50 GMT
Enclosed below is a directory listing of the test area. I use pushd d:\me\Source\Basic\V2RTE to 'Connect' to this area and .\search says to run search from the Current Working Directory. As you can see the .EXE and .TKN are there along with the 8x RTE files. This RTE is copied from the V2 distribution (even though the file dates are the same as the V1.01 distribution). Both .\search ... and search ... respond the same, 'Application Load Aborted Search.tkn not found -OK'
Stop the presses - search (as well as .\search) without any arguments does work fine. So it is the remainder of the command line that confuses the start of the program. Interesting because I was believing that all my CommandLine$ parsing was not going to work either once I got to it. This parsing has been troublesome in the past.
\s\Rick Directory of d:\me\Source\Basic\V2RTE
11/09/2018 10:16 AM <DIR> .
11/09/2018 10:16 AM <DIR> ..
02/28/2018 10:05 AM 1,223,168 jbrun2.exe
02/28/2018 10:05 AM 1,223,168 Search.exe
11/07/2018 05:58 PM 40,105 Search.tkn
12/11/1995 12:10 AM 560,386 VBAS31W.SLL
12/11/1995 12:10 AM 756,129 VGUI31W.SLL
12/11/1995 12:10 AM 35,608 VOFLR31W.SLL
12/11/1995 12:10 AM 11,776 VTHK31W.DLL
12/11/1995 12:10 AM 11,776 VTK1631W.DLL
12/11/1995 12:10 AM 4,608 VTK3231W.DLL
03/03/1999 12:13 AM 200,704 VVM31W.DLL
07/07/2003 11:04 PM 70,656 VVMT31W.DLL
11 File(s) 4,138,084 bytes
2 Dir(s) 151,433,498,624 bytes free
|
|
|
Post by Rod on Nov 9, 2018 17:03:58 GMT
The usual solution for this is to enclose all of the paths within quotes. It is the spaces that confuse either the Just BASIC or Windows path parser. So put a chr$(34) at the start and end of the path string.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 9, 2018 19:15:59 GMT
so I tried this: .\search "e:\photos\t240test sylvan scene Exact" and this: search "e:\photos\t240test sylvan scene Exact" and neither can find a token file and abort as before. BTW all this worked in V1 (up to 9 parameters) without quotes
\s\Rick PS the reinstall suggested in "INI file Error" did not change this situation.
|
|
|
Post by Rod on Nov 9, 2018 20:24:48 GMT
I believe there is an option to specify the path to the .tkn as the first command variable. Perhaps Just BASIC is using your search path to look for the .tkn. Try listing both the path to the .tkn and your search path. You might have to parse out your search path from the info passed into the program.
I stick to the editor mainly so don’t have much experience of firing up from dos
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 11, 2018 0:21:55 GMT
I did not find any documentation on specifying a token file in the command line.
I do the CommandLine$ stuff for two reasons. One is a I have a large BAT file that processes MANY, many different folders in my work area each with a run of one of the programs. It would be quite tedious to process each from a double click or from the Editor Run. Second reason is I have several 'hidden' options in another program. From a double Click or from an Editor Window Run these options are not available. They can be specified from a DOS command window running as above however.
\s\Rick
|
|
|
Post by Rod on Nov 11, 2018 8:54:05 GMT
If you are using a .bat file then try issuing a CD command to set the working directory to that where your Just BASIC files exist. Do that immediately ahead of the call to search.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 11, 2018 14:48:45 GMT
Rod, you are confusing my 'justification for using parameters' with why parameter execution with a V2.0 token is not working.
In the Bat files (as well as a test environment now) I use Pushd <place> prior to running the JB program and Popd after, (pushd / Pop are even better than CD for several reasons.
Again, all this (including Bats) worked with the same JB source compiled on the V1.01 platform with as many as 9 parameters.
\s\Rick
|
|
|
Post by Rod on Nov 11, 2018 16:25:43 GMT
Ok. I have tried running an .exe and associated .tkn from the dos prompt using pushd and cd. The only way I can get an error is if
1) the .tkn does not exist in the directory
2) if it is misnamed
3) I call the .exe from another directory using an explicit path
Do you have file extensions turned off in explorer could it be saved as myprogram.tkn.tkn? Could it be blocked, right click on the .tkn is there any mention of a block in the general pane? UAC may be hiding the file to protect the original user but I'm guessing here.
In any event logged on as me I have no problem with passing parameters via the dos prompt.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 13, 2018 2:28:49 GMT
1 NO 2 NO 3 NO Hidden NO
---------------------
OK I have done a lot of further testing and gotten more information.
First what I had seen in V1 and had been working was a token file along with the JBrun101.exe renamed to the same as the token would work. The program I had writen was one where it expected the following in CommandLine$ parsed with Word$(x):
ProgramName P1 P2 P3 P4 P5 P6 P7 P8 P9
where
ProgramName is the name of the .EXE/TKN file and
P1-P9 were strings.
What my program expected was P1 was a valid Path and P2-P9 were other strings as was seen above.
So from the example above I expected:
ProgramName = Search
P1 = E:\photos\t240test
P2 = Sylvan
P3 = Scene
P4 = Exact
So now in JustBasic V2.0 and a token made from it, I find that the program will run if there are no parameters passed or if I pass in most valid Path strings in P1.
If I pass a string in P1 such as E:\ in P1 I get a "File Not Found: E:\" Application Load Aborted error box.
If I pass a string in P1 such as E:\Place (where place is real BUT not where the program and token is I get: "File not found Search.TKN" Application Load Aborted error box
If I pass a string in P1 such as D:\otherplace (where the program and token are located) I get: "Please regenerate Search.TKN for use with this runtime engine 2.0" Version Incompatibility Box.
If I pass a string in P1 such as D:\otherplace\Search.TKN (the full program and token name) it runs
If I pass a string in P1 such as D:\otherplace\Search.TKN E:\photos\t240test sylvan scene exact (the full program and token name plus all my previously working parameters) I get "File Not Found: Search.TKN" Application load aborted error box.
So it no longer works as the V1 did or as V1 or V2 help on Standalone running imply.
V1:
b)You must rename a copy of JBRUN101.EXE to your liking. This is recommended. Try to create a unique name so that it will be unlikely for any File Manager associations to conflict. If you rename JBRUN101.EXE to MYPROG.EXE, then renaming your *.TKN file to MYPROG.TKN will cause it to be automatically run when the runtime engine starts.
V2:
If you rename JBRUN2.EXE to MYPROG.EXE, then renaming your *.TKN file to MYPROG.TKN will cause it to be automatically run when the runtime engine starts.
My conclusion is:
I would expect that normally modifiying a command would be done with a switch not in the User space of parameters? So something like (Ux) Search -t d:\otherplace e:\photos\t240test\ sylvan scene exact or
Search /t=d:\otherplace e:\photos\t240test\ sylvan scene exact and not intrude into the users' area.
In addition, as in the past with V1, I see a variety of things in the ProgramName portion of CommandLine$.
\s\Rick
|
|
|
Post by Rod on Nov 13, 2018 19:28:44 GMT
I am not sure I understand what is broken. If you have a very simple .exe that simply prints the CommandLine$ that is passed what works and what fails? In my simple tests anything I put after the dos box command line .exe name is passed to CommandLine$ and I get no errors..
So keeping it real simple what do I have to do to get the error when calling my simple .exe?
|
|
|
Post by Chris Iverson on Nov 14, 2018 6:32:00 GMT
Out of curiosity, are you able to zip up a copy of your program(or a similar program that demonstrates the same issue) and provide the complete package to us?
|
|
|
Post by Rod on Nov 14, 2018 12:58:42 GMT
This from a previous question using bat files. Stefan isn’t usually wrong but it is the only mention I can find. And this was was prior to v2
However, when I use the DOS command SCHTASKS within a .bat file to schedule execution of the .exe file, I get an error message stating that the .tkn file cannot be found. I tried placing a copy of the .tkn file within a folder that is in the search path and still get the same error message. Where should the .tkn file be located in this situation? Does Liberty BASIC enable the creation of a stand-alone .exe file? > > Thanks in advance for all constructive suggestions! >
Ad 1) LB4 does only support two-dimensional arrays too.
Ad 2) LB does not support single EXE distribution either
You can specify the full path to the TKN file as the first command line parameter of the renamed runtime engine or you set the working folder of the scheduled task to the folder containing the EXE and TKN.
So worth trying the full correct path to the .tkn as p1
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 14, 2018 16:26:14 GMT
Well I am working on stripping all the excess, but not yet all the warts, out of Search for closer examination. What will I do with the ZIP when ready?
In debugging this strip-down process I have come to the conclusion that my difficulties all stem from the fact that V1 did not expect/assume a token path in P1 and V2 assumes it is. If I put a valid path to where the RTE kit is then the program works.
\s\Rick
|
|