English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 02 December 2022, 04:13   #1
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
ARexx Including One Script Into Another

Hi all!

Another ARexx question

Is it possible to include one ARexx script into another? Something like include in C? (I scoured the Internet but couldn't find an answer...)

Thanks!
tygre is offline  
Old 02 December 2022, 07:59   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,010
You can use CALL to run another script. Or, if the other script shall return a value, you can just call it as a function. But you cannot share global variables. Every data has to be transferred as parameters and return values.
thomas is offline  
Old 02 December 2022, 14:17   #3
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,305
And if you need, you can use message ports for interaction among different scripts.
daxb is offline  
Old 02 December 2022, 22:06   #4
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Thomas and Daxb!

Thanks for your answers!

I actually wanted to avoid either solution because I would need to pass data to the other script, which would require to PUSH/QUEUE data, which would be as long as the small piece of code that I want to "share" across many scripts

That's okay, I'll duplicate some (little) code across scripts, not such big a deal even if it's not DRY...

Thanks!
tygre is offline  
Old 03 December 2022, 11:45   #5
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,305
There is also SETCLIP(), RXSET and GETCLIP() to share global variables (simpler then message ports). I use this for three scripts to share small data. Read the explanation of this functions/command in ARexxGuide2. There is also an example "Global variables on the clip list".
daxb is offline  
Old 05 December 2022, 17:45   #6
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Thanks Daxb!
tygre is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Request DOpus4 ARexx script to copy comments EctoOne Coders. Scripting 0 02 November 2022 17:15
Icon position clearence by Script/ARexx ? logical support.Apps 6 01 November 2018 16:38
Problem executing DOpus5 Arexx Script ... beltrixx support.Apps 1 01 August 2015 22:16
Simple NewShell script?.. in Arexx? Yoji Coders. General 5 19 May 2015 14:49
Arexx script (txt => hex) Uukrul Coders. General 10 09 September 2001 04:02

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:25.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07236 seconds with 15 queries