Welcome, Guest. Please login or register.

Author Topic: Parameters in RequestChoice / RequestFile commands  (Read 2469 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kolla

Re: Parameters in RequestChoice / RequestFile commands
« on: November 21, 2020, 10:46:51 PM »
Why system wide setenv and not just shell local set?

Why backtick getenv var instead of just using ${var}?
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: Parameters in RequestChoice / RequestFile commands
« Reply #1 on: November 22, 2020, 06:14:29 PM »
because i don't know better. :)

But you’re using $var with eval, so I’m confused about what you know or not :)

Setenv/getenv is for system global variables, and these are saved as files in ENV: and you can make them survive boots by also saving them in ENVARC:

Set/get are for shell local variables, they are only accessible from within the shell they were made.

In general it is advisable to use local variables in scripts - if you use global variables, you risk that scripts stumble in its other’s feet as they potentially share variables... for example if same script is running twice, at once.

And local shell variables overrides global variables.

When referring to variables in the shell or shell scrips, you use dollar sign in front of the variable name - for example $var, so no need for backticking getenv or get.

But it is good practice to use curly brackets around variable names, as that allows you to have special signs in them, for example global variables may have / in their names, when stored in a directory in ENV: - for example ${bla/myvar} which refers to the content of file env:bla/myvar


Sadly, even latest 3.1.4.1 RequestChoice is rather braindead and doesn’t automatically wrap lines that are long, so you can easily make requesters that would be wider than the screen, if that was possible, so the requester is typically “cut” at screen width, and if there’s only one button, it may very well be hidden “outside” of the screen, unreachable by pointer. In his infinite wisdom, the chief OS developer decided that no window is allowed to be wiser than screen to prevent exactly this thing from happening, yet here we are... and if a requester was allowed to actually be wider than screen, you could have dragged and pulled it to the left till button was reachable, but we cannot have that, because... Microsoft Windows!! *spit pfffeh* Luckily there is a way out from this “bug” if you get there, and that is to use left-amiga + v or left-amiga + b, the former being equivalent to pressing leftmost button (typical “ok”), and the latter equivalent to rightmost button (typical “cancel”) and if only one button.. act as if there was an invisible cancel there.

So yeah, instead of having automatic flow, we must use *N and create newlines ourselves... and we are also stuck with “system screen font” for requester body. And you cannot select and copy from requester. And... and... meh.
« Last Edit: November 22, 2020, 06:29:59 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: Parameters in RequestChoice / RequestFile commands
« Reply #2 on: November 24, 2020, 10:25:55 PM »
@nbache

Thank you for bringing some sanity to this madness :)
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS