Page 2 of 4
Re: Call to undefined function: cbtstate
Posted: 03 May 2015 00:23
by PeterH
I think you really can be sure when you have seen them all

Re: Call to undefined function: cbtstate
Posted: 03 May 2015 12:58
by admin
I decided to be tolerant with 1-character arguments. The help, website, and forum are full of such examples...
Re: Call to undefined function: cbtstate
Posted: 03 May 2015 14:59
by PeterH
admin wrote:I decided to be tolerant with 1-character arguments. The help, website, and forum are full of such examples...
Hm - 2 souls in by breast
Before I say more, just a question: where or how will this be allowed? 2 extreme examples:
- only in defining arguments of functions, eg func($x, a)
- for constructs like $t=a.B.$c; // same as 'a' . 'B' . $c
or something else?
Basic, what I'm thinking about, if expanding syntax here: not only allow 1-char-arguments, but tokens, i.e. simple words, alphanumeric-only, either only stand-alone, or even delimited by any other character like space, dot, bracket, whatever. (Maybe specials like _ could be allowed.) Allowed would be,
at least the first 2:
file
file10
file.10
file . 10
file . $nr
file 10 // illegal, like 'file' '10' --> concatenation missing
file $nr // illegal, like 'file' $nr
Prefered usage would be for codewords.
If XY-functions exist using codewords outside this naming scheme, they should be changed.
Re: Call to undefined function: cbtstate
Posted: 03 May 2015 17:48
by bdeshi
-1/2.
standard tokens may be accepted unquoted in their rightful places, but just any string shouldn't be.
Re: Call to undefined function: cbtstate
Posted: 03 May 2015 19:09
by admin
I cannot do more here for now.
Re: Call to undefined function: cbtstate
Posted: 04 May 2015 12:03
by PeterH
Another

at
strict syntax (sorry that that's all in this thread

)
If (%computername% == 'PCB') {
Dubious syntax: %computername%
%...% is variable and shouldn't need quotes. I think forgotten?
(While it seems <...> is OK - never saw this flagged.)
Edit: all about Strict should be in a thread "Strict Syntax Checking for Scripts", I think.
Does someone want to split?
Re: Call to undefined function: cbtstate
Posted: 04 May 2015 12:45
by admin
Yes, bug. (No time to split)
Re: Call to undefined function: cbtstate
Posted: 04 May 2015 13:15
by PeterH
Bug: I thought so. No wonder, for this new service. I love it!
Split: I thought of one of the
other admins 
You shouldn't, of course.
(I think they are able to, are they?)
Re: Call to undefined function: cbtstate
Posted: 04 May 2015 14:07
by bdeshi
Actually just renaming this topic is a better idea. it starts with an error caused by a syntax error, then
PeterH we all talk about catching typos and other sytnax errors.
(And
wherever Peter might've
[most recently] started this march against syntax-ignorance, this topic is clearly the new home.)
Done!
Re: Strict Syntax Checking for Scripts
Posted: 04 May 2015 16:57
by PeterH
Different action, same result
Hope Klownboy will not miss his thread
Thanks

Re: Strict Syntax Checking for Scripts
Posted: 04 May 2015 18:37
by klownboy
Hi PeterH, no I certainly won't miss the thread (title).
For information only (now solved), in the last few minutes I received a function error similar to what I originally posted on a different script which has worked successfully for over a year. This time no spelling error.

It works with USBDLM
http://www.uwe-sieber.de/usbdlm_e.html to add a tab with the external drive name and safely remove the drive and re-enable the drive when safely removed but not physically removed. Anyway, this line is now throwing out a "
Call to undefined function" function error. Note I do not have the extended error checking tweak enabled.
Code: Select all
perm $drive_name = CRUZER16 (J:);
When flash drive removal is requested, this line in the USBDLM file runs this code...
Code: Select all
open="D:\Tools\XYplorer\XYplorer.exe" /script="::perm $drive_name = %VolumeLabel% (%drive%); load remove_drive_USB.xys, '_TABLABEL';" /flg=2 /hwnd=<hwnd>
As it turns out, my code line in the USBDLM ini file which establishes the perm variable wasn't quoted. XY was tolerant of this before but not now. Adding the single quotes around the perm variable establishment solved the problem and yes, it should have been there from the start.

Re: Strict Syntax Checking for Scripts
Posted: 05 May 2015 11:32
by PeterH
@klownboy: I didn't really expect it a problem - just wanted to mention
New
*$scnt++;
Dubious syntax: *$scnt

That's in a loop of several 100 iterations
Here I would love "
Setting Strict, 0" to switch it off for part of this script!
Re: Strict Syntax Checking for Scripts
Posted: 05 May 2015 12:04
by admin

Fix comes.
Re: Strict Syntax Checking for Scripts
Posted: 05 May 2015 13:06
by TheQwerty
PeterH wrote:Here I would love "Setting Strict, 0" to switch it off for part of this script!
Code: Select all
$a = '$i';
*$a++;
$tsss = tweak('ScriptStrictSyntax', 0);
*$a++;
tweak('ScriptStrictSyntax', $tsss);
*$a++;
Re: Strict Syntax Checking for Scripts
Posted: 05 May 2015 16:00
by bdeshi
But to me it seems eval() has complete disregard for any kind of quotes...
