Page 3 of 3
Posted: 12 Feb 2008 10:07
by PeterH
I only had one problem regarding *this*.
Otherwise I'm a poor man...
But now I have a second problem: hava a 'base', and must append "old", i.e.
set $file, "base" (this is filled by some logic)
set $f2, $file "old"
should set $f2 to "baseold"
How to do such ?
Sometimes it sems, as if you think of the quoted strings in another way as I do - so you might await problems, when there are none? Some day ago I gave you some samples of coding in "full-quoted style" - did you see any problems there? (As I always find problems in your "non-fully quoted style"...)
Other point: is it correct, that you only can quote with " but not with ' ?
Posted: 12 Feb 2008 10:40
by admin
PeterH wrote:I only had one problem regarding *this*.
Otherwise I'm a poor man...
But now I have a second problem: hava a 'base', and must append "old", i.e.
set $file, "base" (this is filled by some logic)
set $f2, $file "old"
should set $f2 to "baseold"
How to do such ?
set $f2, $fileold
Currently scripting variables don't know word boundaries. They are resolved wherever they are found, in the order of their creation. However, you can simply add your own boundary to the variable to avoid conflicts:
set <file>, "base"
set <f2>, <file>old
Try this in the address bar:
::set <file>, "base"; set <f2>, <file>old; msg <f2>
Posted: 12 Feb 2008 11:32
by PeterH
No, no?
You don't want to teach people, that they're not allowed to use var $base and $base1?
And isn't it better, instead of starting to "quote" (some) variables with <>, to quote all strings with""?
By the way: is var xxx same as <xxx>, or is this different?
No testing in the moment: no XY here at work...
Posted: 12 Feb 2008 12:41
by TheQwerty
So under what conditions must an argument be double quoted?
When it could contain a comma, quote, or when it's an application path for open?
Wouldn't escaping these things with \ or ` make a lot more sense?
Posted: 12 Feb 2008 14:04
by PeterH
TheQwerty wrote:So under what conditions must an argument be double quoted?
When it could contain a comma, quote, or when it's an application path for open?
Wouldn't escaping these things with \ or ` make a lot more sense?
Sorry - I'm not sure I understand?
Double-quoting, i.e. use of 2 consecutive quotes, should be used to represent the use of 1 quote-char in the string, or am I wrong?
(Or did you mean use of " instead of ' ? What's the english name of " ?)
And your escaping - isn't it a kind of quoting with a variable character, so you could write
/a,b/ or -a,b- or 'a,b' or "a,b" or \a,b\
If I understand it correct, the 1st char is always understood as escape, so you must always write escaped string. And what I want is the same - but restricted to " and maybe ' as "escape".
And this can (if defined so) have the advantage, that variables can only be allowed outside of the quotes - and I can differentiate between string xxx (inside a quote) or variable xxx outside. That is: much more reliable for me!
Or did you mean something else?
Posted: 12 Feb 2008 14:24
by admin
TheQwerty wrote:So under what conditions must an argument be double quoted?
When it could contain a comma, quote, or when it's an application path for open?
If you mean by double-quoted "..." then if it contains a seaparator (; or ,).
If you mean by double-quoted ""..."" then if it is quoted ("...").
::msg "has,sep;s"
::msg ""quoted""
BTW,
::msg " will crash the current beta. Fix comes tomorrow.
Posted: 12 Feb 2008 14:25
by PeterH
Just something else: a thought to the thing you call "caption & label". In between the time I would like to name it "label & caption"! And for a label, (that you perhaps lateron will need without the caption,) I would prefer "a single word without special chars".
So why not change the sequence, and perhaps define:
- a label begins in col 1
- a label must be one word, without special characters
- a label may be followed by a caption - maybe in ()
- default for caption is the label
Example
label (Copy a, b) set x,"y";
...
If you later need a label inside a script, you don't need to change any syntax.
The important aspects for me are: label is first word, and never needs quotes. Same for the label in a call. (Caption could maybe have quotes? maybe (...) is enough?)
You might possibly have a problem with end of one / beginning of another script...
...but if, in future, a label inside a script should not begin in col 1, (in the moment meaning: start a new script,) labels could be defined as such by adding a char, like label: or :label?) Problem is: it should be defined now - not changed later!
Posted: 12 Feb 2008 14:35
by admin
PeterH wrote:Just something else: a thought to the thing you call "caption & label". In between the time I would like to name it "label & caption"! ...

Is there any problem you are trying to solve here?
I need the quotes to distinguish script with caption from scripts without.
Posted: 12 Feb 2008 14:48
by TheQwerty
admin wrote:TheQwerty wrote:So under what conditions must an argument be double quoted?
When it could contain a comma, quote, or when it's an application path for open?
If you mean by double-quoted "..." then if it contains a seaparator (; or ,).
If you mean by double-quoted ""..."" then if it is quoted ("...").
::msg "has,sep;s"
::msg ""quoted""
BTW,
::msg " will crash the current beta. Fix comes tomorrow.
Is there any chance at all we could have a way to use " as an alternative to ""?
Posted: 12 Feb 2008 15:04
by PeterH
TheQwerty wrote:
Is there any chance at all we could have a way to use " as an alternative to ""?
Sorry, for my understanding: could you make a sample of an expression in the form you would like? And could you have, in this sense, not-quoted strings?
Posted: 12 Feb 2008 15:10
by PeterH
admin wrote:PeterH wrote:Just something else: a thought to the thing you call "caption & label". In between the time I would like to name it "label & caption"! ...

Is there any problem you are trying to solve here?
I need the quotes to distinguish script with caption from scripts without.
In the moment my only problem is the form: a label inside a quoted string is verv very strange to me. Same for a label, that is not at the beginning of the stmt. While I see the caption just as an extension to the label - not the other way round.
In the future I hope, that we will have labels inside a script. (Maybe for loops etc.) And I think you would have a problem, if the syntax for a label is "caption : label", isn't it?
Posted: 12 Feb 2008 16:46
by admin
PeterH wrote:admin wrote:PeterH wrote:Just something else: a thought to the thing you call "caption & label". In between the time I would like to name it "label & caption"! ...

Is there any problem you are trying to solve here?
I need the quotes to distinguish script with caption from scripts without.
In the moment my only problem is the form: a label inside a quoted string is verv very strange to me. Same for a label, that is not at the beginning of the stmt. While I see the caption just as an extension to the label - not the other way round.
In the future I hope, that we will have labels inside a script. (Maybe for loops etc.) And I think you would have a problem, if the syntax for a label is "caption : label", isn't it?
This is not a jump-to-label, but an identifier. Caption is a visual identifier, label is a programmatic identifier. Beautiful symmetry wherever I look. Divine perfection. Never change a beautiful horse.
Posted: 15 Feb 2008 08:15
by admin
I hope I don't shock anybody, but...
The prefixed double-colon ( :: ) is a marker for "global namespace" in the C++-world and also in Explorer. For example. enter this into an Open-UDC:
::{645FF040-5081-101B-9F08-00AA002F954E}
and you will open the recycle bin.
So, hmmm... maybe it would be wise to choose another "script marker" for XYplorer??? I don't want to run into any conflicts or ambiguities...