Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
37 user(s) are online (29 user(s) are browsing Forums)

Members: 1
Guests: 36

NinjaCyborg, more...

Support us!

Headlines

 
  Register To Post  

« 1 2 (3)
Re: New Screen Shot and SketchBlock gallery.
Just can't stay away
Just can't stay away


See User information
Quote:

Hans wrote:
It will take some extra work, but SketchBlock could always process the paths to make them absolute before sending them to arexx.class. There are two possible options:
- Check if the path is relative or absolute; if it is relative, then add SketchBlock's absolute path
- If the path in the prefs file has PROGDIR: at the start, then replace that with SketchBlock's absolute path


@broadblues

Just to add to the above, to get the absolute path you just need to call DevNameFromLock() on the lock returned from GetProgramDir().

DevNameFromLock(GetProgramDir(), buffer, buffer_size, DN_FULLPATH);

Go to top
Re: New Screen Shot and SketchBlock gallery.
Amigans Defender
Amigans Defender


See User information
@broadblues

Quote:

broadblues wrote:

Sending script commands to ARexx (via arexx.class at least) requires an absolute path to the script.

None of the script locations or any paths are hard coding into SketchBlock they are all setup via the xml prefs file.

But putting <command>SketchBlock:Rexx/SaveAsBrush.rexx</command> in your XML prefs file - as you do - means exactly that: hardcoding it! Instead, you should:

1. Store only the script name in the prefs file, eg. <command>SaveAsBrush.rexx</command>
2. Call IDOS->GetVar("ENV:AppDir/SketchBlock", ... ) to obtain the absolute path to the SketchBlock directory.
3. Construct the full path of the script by appending "Rexx/" and the script name (from the XML file) to the program path obtained in Step 2.
4. Call the script via ARexx.

I can't see why this wouldn't work.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: New Screen Shot and SketchBlock gallery.
Home away from home
Home away from home


See User information
@trixie
Quote:

Quote:

@broadblues

Quote:
broadblues wrote:

Sending script commands to ARexx (via arexx.class at least) requires an absolute path to the script.

None of the script locations or any paths are hard coding into SketchBlock they are all setup via the xml prefs file.

But putting <command>SketchBlock:Rexx/SaveAsBrush.rexx</command> in your XML prefs file - as you do - means exactly that: hardcoding it! Instead, you should:


Well I supose that depnds on your definition of "hard coded"

The preferences are entirely user editable, so may be changed to anything the user desires. I'm not sure why you find the sketchblock: assign so problematic, it's not exactly an unheard of concept for apliacation to have a assign to some data directory ot other.

Looking at my assign list I see:
AMISSL         AmigaOS4:Devs/AmiSSL
ANTIWORD       AmigaOS4
:Utilities/antiword
Apache         Work
:NetApps/Apache-1.3.33
APOD           Work
:aPod
ARTEFFECT      Work
:ArtEffect4-Demo
AWebPath       Work
:NetApps/AWebPPC
AWEB_APL       Work
:NetApps/AWebPPC
C4D            Work
:Cinema4D
C4DCD          
<CINEMA4D_CD-Edition:Bonus>
CVSHOME        AmigaOS4:Home
FreeDB         Music
:FreeDB
FTPMountDir    AmigaOS4
:FTPMountDir
GCC            Programing
:SDK/gcc
GHOSTSCRIPT    AmigaOS4
:Utilities/Ghostscript
imagefx4       Work
:ImageFX4
MUI            AmigaOS4
:MUI
PGP            Work
:PGP5
PPaint         Work
:ppaint
PYTHON         AmigaOS4
:System/Python
TEX            Work
:Cinema4D/Textures
TurboPrint     AmigaOS4
:TurboPrint
YAM            Work
:NetApps/YAM


Some added by me some by the installation processes of those apps, some that come with the system.

Quote:

1. Store only the script name in the prefs file, eg. <command>SaveAsBrush.rexx</command>
2. Call IDOS->GetVar("ENV:AppDir/SketchBlock", ... ) to obtain the absolute path to the SketchBlock directory.
3. Construct the full path of the script by appending "Rexx/" and the script name (from the XML file) to the program path obtained in Step 2.
4. Call the script via ARexx.


I could do some variation on that, I'm not sure using appdir: is reliable for thsi purpose, some users write protect their sys: partitions rendering it inopperable. And I certainly wouldn't hardcode in the Rexx drawer

Quote:

I can't see why this wouldn't work.


Well it would in so far as it would launch scripts, but it's not so simple as that. As well as scripts you'll see there are 'commands' in the xml file, these are direct calls to the sketchblock arexx interface.

Given that a script need not have an extention there is no way for me to distinguish commands from scripts (save search my commands list before invoking, but that's allready done bt the ARexx.class, it would be silly to do it twice.

Oh and another thing, ARexx searches for scripts without absolute path name in REXX:

Go to top

  Register To Post
« 1 2 (3)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project