LB Booster
Programming >> Language extensions >> run [,wait]
http://lbb.conforums.com/index.cgi?board=extensions&action=display&num=1425321523

run [,wait]
Post by Alincon on Mar 2nd, 2015, 5:38pm

What am I doing wrong?
I'm getting syntax error or invalid label, depending on where I put the [,wait] - (before or after the command line parameter)

Code:
    run "c:\libbas\_mylibbas\personnel\tokens\lookupNames.tkn ";"*.sal"[,WAIT]"  


r.m.


Re: run [,wait]
Post by Richard Russell on Mar 2nd, 2015, 5:57pm

on Mar 2nd, 2015, 5:38pm, Alincon wrote:
What am I doing wrong?

Are you literally including the square brackets in the command? That would certainly result in an error.

The syntax notation is borrowed from BNF (Backus-Naur Form), although used in an informal way as it says in the docs: "In the informal syntax definitions square brackets [] indicate optional items, braces {} indicate items which may be repeated zero or more times, and the pipe symbol | indicates alternatives":

http://www.lbbooster.com/lbb.html#keywords

Richard.
Re: run [,wait]
Post by Alincon on Mar 2nd, 2015, 8:10pm

Yeah, I know the brackets indicate an optional parameter.
But I tried it several ways and none of them worked. I just showed you the last one I tried.

This works in LB4:

Code:
run "c:\libbas\_mylibbas\personnel\tokens\lookupNames.tkn ";"*.sal"
 


I tried putting ",wait" after the command line parameter and got the message "Windows can not open this file"

Pls advise.

r.m.
Re: run [,wait]
Post by Richard Russell on Mar 2nd, 2015, 9:22pm

on Mar 2nd, 2015, 8:10pm, Alincon wrote:
Pls advise.

Sorry, I have absolutely no idea. The WAIT option works OK here, and I have no explanation for how it could fail to work for you. Presumably you find the other (LB compatible) options such as HIDE and MINIMIZE to work correctly, which makes the failure of WAIT even more strange.

In the circumstances I can only suggest that you abandon LBB and return to using LB 4.04. I know of another user who has recently made that decision, having become disillusioned with LBB.

Quote:
"Windows can not open this file"

Irrespective of the WAIT issue, you'll receive that error anyway if the TKN extension isn't associated with an executable, which normally it won't be.

Richard.

Re: run [,wait]
Post by Alincon on Mar 2nd, 2015, 11:20pm

Can't you just put up an example of run...wait that works?

In fact, should not every command have an example?

Not all of your users are as smart as you.

r.m.
Re: run [,wait]
Post by tsh73 on Mar 3rd, 2015, 07:50am

run EXE with WAIT
Code:
print 1, time$()
run "notepad.exe", wait
print 2, time$()
 

run EXE with WAIT, passing parameter
Code:
print 1, time$()
run "notepad.exe test.txt", wait
print 2, time$()
 

One LBB program calls another LBB EXE (I really have no idea if LBB supposed to execute LB TKNs??? - and that could be your "What I am doing wrong" thing, actually)
program testTKN.bas, to be compiled to EXE
Code:
print "TKN"
print time$()
print CommandLine$
input "Press ENTER to continue";dummy$
print "TKN over" 

caller program (to be run from IDE)
Code:
print 1, time$()
run "testtkn.exe test.txt", wait
print 2, time$() 


Bottom line: it works for me - with EXE.
Check if you really need that TKN - it could be EXE, or LBB compiles to *.LBB

You can make LBB
Run\Make *.LBB file
but somehow I could not pass papameter to it
Code:
print 1, time$()
'run "testtkn.exe test.txt", wait
'run "LBBRUN.exe testtkn.lbb"  ' works
'run "LBBRUN.exe testtkn.lbb", wait  'works
run "LBBRUN.exe testtkn.lbb test.txt", wait
'runtime ends up with message
'  File or path not found
'  >
'- it looks like a prompt. What command it waits for?
print 2, time$() 

Re: run [,wait]
Post by Richard Russell on Mar 3rd, 2015, 09:02am

on Mar 2nd, 2015, 11:20pm, Alincon wrote:
Can't you just put up an example of run...wait that works?

I really can't, because evidently what works on my system doesn't work on yours. sad

Anatoly has listed some simple examples in his reply, but based on what you have said they are not going to work on your PC because of some unexplained incompatibility.

There seems to be an underlying issue with LBB v3.00 which is causing it to work differently on different PCs, and I have no idea why. You are finding the WAIT option doesn't work, but it works here. Anatoly is finding the Syntax Colouring doesn't work with Courier New, but it works here. Hans is finding he can't scroll the Debug window, but it works here!

Do people think I should withdraw v3.00 until the cause(s) can be established?

Richard.
Re: run [,wait]
Post by Richard Russell on Mar 3rd, 2015, 09:18am

on Mar 3rd, 2015, 07:50am, tsh73 wrote:
but somehow I could not pass parameter to it

No, sorry, you can't. Given this command:

Code:
run "LBBRUN.exe testtkn.lbb test.txt", wait 

LBBRUN receives as its command-line "testtkn.lbb test.txt" which confuses it.

To make it work LBBRUN would need to parse its command line to work out which part was the name of the program (the LBB file) and which part was a parameter or parameters to be passed to that program.

I'm not sure whether that is practical or not. You can't simply split the command line at the first space, because the path to the LBB file might include a space. I suppose in that case one would need to use quotes:

Code:
run "LBBRUN.exe ";chr$(34);"\path to\testtkn.lbb";chr$(34);" test.txt", wait 

To be honest I wonder whether LBBRUN.EXE will ever be used enough to justify such a capability (especially given the security issues surrounding the unencrypted LBB files).

But if there is a consensus that it would be useful I could look into it.

Richard.
Re: run [,wait]
Post by Alincon on Mar 3rd, 2015, 2:59pm

For what it's worth, my opinion on withdrawing v3.0 because some features do not work well for some people is - please do not.

The value of so many improvements outweighs the negatives of some things evidently not working for some people.

As for run,wait, I can get the same effect by using !include.

I just discovered the goto option at the bottom of the edit menu. I like the syntax coloring, the page setup, the compare file, and so many others.

r.m.
Re: run [,wait]
Post by Richard Russell on Mar 3rd, 2015, 5:28pm

on Mar 3rd, 2015, 2:59pm, Alincon wrote:
For what it's worth, my opinion on withdrawing v3.0 because some features do not work well for some people is - please do not.

I was only suggesting temporarily pulling it, to give me a chance to locate the bugs. But it seems that the Debug scroll problem was Hans' misunderstanding of a deliberate feature, and I'm still not sure whether RUN WAIT is working for you or not, so the only 'definite' issue is Anatoly's broken Syntax Colouring when Courier New is selected.

I know (and it's mentioned in the docs) that if the selected font doesn't contain all the glyphs required by the current document (i.e. BASIC program) the RichEdit control will fall back to an alternative font which does. Unfortunately that definitely will break the Syntax Colouring, which assumes all the text is rendered in the same font.

My experience has been that Courier New has one of the most extensive ranges of Unicode glyphs, and therefore doesn't usually require a fallback font. But I wonder if the version installed on Anatoly's PC is a special one (maybe for the Russian code page) which isn't so complete.

So it's at least possible that bugs in LBB aren't responsible for the reported issues. I'll wait to see what the future holds.

Richard.
Re: run [,wait]
Post by SarmedNafi on Mar 4th, 2015, 1:20pm

> DIM array(size{,size}) {, array(size{,size})}

Richard,

What is all these brackets? It confuse us.
It drive us to make mistakes, we are not smarts OK?
Would you please use a normal line of code, OK don't write an example, just a normal line of code, instead of all these brackets.
Thanks a lot for your effort in LBB300.

Sarmed