Scripting: User-Defined Functions
Re: Scripting: User-Defined Functions
Next (I think)
Defaults for parameters are specified without quotes. If you use quotes they are part of the default value.
But: I need special characters, like blank or ')'
So I think defaults should should be quoted as every string?
By the way: if not defining a default, and not supplying a value for a variable, the default is ""?
Defaults for parameters are specified without quotes. If you use quotes they are part of the default value.
But: I need special characters, like blank or ')'
So I think defaults should should be quoted as every string?
By the way: if not defining a default, and not supplying a value for a variable, the default is ""?
Win11 Pro 223H2 Gerrman
Re: Scripting: User-Defined Functions
Win11 Pro 223H2 Gerrman
Re: Scripting: User-Defined Functions
By the way: you always write like:
User | ... is only defined if you have defined it
(and is there need for it, in this case?)
I think people usually don't use User | ... but Scripting | Load Script File or Scripting / Load Selected Script File.! Scripting: Included functions were effectively not updated after loading a
script using User | Run Script | Load selected script file. Fixed.
User | ... is only defined if you have defined it
(and is there need for it, in this case?)
Win11 Pro 223H2 Gerrman
-
- Site Admin
- Posts: 60547
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Scripting: User-Defined Functions
Whoops, what a stupid oversight. I happen to have a UDC with that same name (just for testing).
FAQ | XY News RSS | XY Twitter
Re: Scripting: User-Defined Functions
Hoppala - for .317:
I wrote defaults as $b01='ol', i.e.used single quotes. The quotes were taken into the variables
With double quotes OK
(Should I stop testing?
No problem - I'm hungry now )
I wrote defaults as $b01='ol', i.e.used single quotes. The quotes were taken into the variables
With double quotes OK
(Should I stop testing?
No problem - I'm hungry now )
Win11 Pro 223H2 Gerrman
-
- Site Admin
- Posts: 60547
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Scripting: User-Defined Functions
No, you should stop using single quotes. They are not supported here.
FAQ | XY News RSS | XY Twitter
Re: Scripting: User-Defined Functions
not good.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Scripting: User-Defined Functions
Is the emoticon you wanted to use:admin wrote:No, you should stop using single quotes. They are not supported here.
As I don't think it makes sense this way!
Reason: you would have to teach new rules for this one case to all scripters:
- don't use 'single quotes'
- don't double double quotes inside double quotes ( ) not ="""c:\a b\""" but =""c:\a b\""
- maybe more? Please document!
Or use the rules valid for all other situations, like
global $a='"c:\a b\"'; // For me this is almost the same use case, isn't it?
So I hope it was a joke
(Thanks, Sammay )
Win11 Pro 223H2 Gerrman
-
- Site Admin
- Posts: 60547
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Scripting: User-Defined Functions
good pointSammaySarkar wrote:not good.
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 60547
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Scripting: User-Defined Functions
Yes, just added. It's the weather...PeterH wrote:Is the emoticon you wanted to use:admin wrote:No, you should stop using single quotes. They are not supported here.
As I don't think it makes sense this way!
Reason: you would have to teach new rules for this one case to all scripters:
- don't use 'single quotes'
- don't double double quotes inside double quotes ( ) not ="""c:\a b\""" but =""c:\a b\""
- maybe more? Please document!
Or use the rules valid for all other situations, like
global $a='"c:\a b\"'; // For me this is almost the same use case, isn't it?
So I hope it was a joke
(Thanks, Sammay )
FAQ | XY News RSS | XY Twitter
Re: Scripting: User-Defined Functions
Weather, yes!
My feet hurt - I walked some km on the A33 (That's the German highway 33 ) (between testing )
(OK: this is a piece that's just on construction, so no problems with traffic.)
This says: weather in Germany is very fine sunny, sunny, sunny
There's an emoticon , but none for the sun
OK: I'll try
Sorry for OT
PS: just found out why you changed your mind: you thought about documenting the new rules
My feet hurt - I walked some km on the A33 (That's the German highway 33 ) (between testing )
(OK: this is a piece that's just on construction, so no problems with traffic.)
This says: weather in Germany is very fine sunny, sunny, sunny
There's an emoticon , but none for the sun
OK: I'll try
Sorry for OT
PS: just found out why you changed your mind: you thought about documenting the new rules
Win11 Pro 223H2 Gerrman
Re: Scripting: User-Defined Functions
Tested, even some strange (= never used) parameter combinations: all well.
Not bad!
To be true: very very lucky. I've waited for this quite a time - and now it's there.
...and enjoyed testing
Thanks a lot!
And so many new abilities
Not bad!
To be true: very very lucky. I've waited for this quite a time - and now it's there.
...and enjoyed testing
Thanks a lot!
And so many new abilities
Win11 Pro 223H2 Gerrman
Re: Scripting: User-Defined Functions
Code: Select all
$b = 'var_$b';
echo q();
function q($a = "1" . "2" , $b) { return $a . | . $b ; } //returns 1" . "2|var_$b
Code: Select all
function q($a = """1" . """2" , $b) { return $a . | . $b ; } //returns "1" . "2"|var_$b
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]