Post Reply 
Emu48 Edit a CSV File
01-10-2022, 12:41 PM
Post: #23
RE: Emu48 Edit a CSV File
(01-09-2022 08:39 PM)MNH Wrote:  
(01-09-2022 02:34 PM)DavidM Wrote:  SL3: Source string
SL2: Target string to be replaced
SL1: Replacement text that takes the place of target

targ: the text which will end up being replaced in the source string
new: the replacement text for each target encountered
len: the length of the target text (not the length of the source text)

The stack arguments, SL1 through SL3, don't correspond with the local variables targ, new, and len.

You are correct, and it is intentional. There's no reason the stack arguments for REPLS have to be the same as the local variables defined for use within the program.

(01-09-2022 08:39 PM)MNH Wrote:  I think my problem is that I don't know, or are confused by, what should be on the stack to make REPLS work. I executed REPLS, and the program didn't remove the line feed character from the first extracted string. Also, the program ended up in an infinite loop.

Rather than responding with a lengthy line-by-line breakdown of how REPLS works (which I started to do and subsequently closed the window by accident before posting :-) ), I'd recommend that you actually step through the code and watch how it operates. Two possible ways to do this:

1) Place some simple arguments on the stack (I'd suggest "ABCDE" "BCD" "X" as a first attempt)
2) Put 'REPLS' on the stack (single quotes required)
3) Execute DBUG by navigating to PRG -> NXT -> RUN -> DBUG and pressing "DBUG"
4) Step through the code with SST to watch how it loads the stack and proceeds

-or-

1) Place 41 MENU HALT at the beginning of REPLS.
2) Place some simple arguments on the stack (I'd suggest "ABCDE" "BCD" "X" as a first attempt)
3) Execute REPLS
4) Step through the code with SST to watch how it loads the stack and proceeds

Make sure that you are actually passing strings to REPLS, not variables which contain strings. That might be one issue you are running into.

If you have truly found a combination of string arguments passed to REPLS that results in an infinite loop, please post an example so that the code can be fixed to accommodate that situation.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Emu48 Edit a CSV File - MNH - 12-30-2021, 07:24 AM
RE: Emu48 Edit a CSV File - MNH - 12-30-2021, 04:34 PM
RE: Emu48 Edit a CSV File - MNH - 12-30-2021, 10:30 PM
RE: Emu48 Edit a CSV File - DavidM - 12-31-2021, 10:54 AM
RE: Emu48 Edit a CSV File - MNH - 12-31-2021, 06:11 PM
RE: Emu48 Edit a CSV File - MNH - 01-01-2022, 04:41 AM
RE: Emu48 Edit a CSV File - DavidM - 01-04-2022, 03:48 PM
RE: Emu48 Edit a CSV File - MNH - 01-04-2022, 11:32 PM
RE: Emu48 Edit a CSV File - DavidM - 01-05-2022, 12:14 PM
RE: Emu48 Edit a CSV File - DavidM - 01-08-2022, 11:22 AM
RE: Emu48 Edit a CSV File - MNH - 01-08-2022, 04:41 PM
RE: Emu48 Edit a CSV File - MNH - 01-08-2022, 07:41 PM
RE: Emu48 Edit a CSV File - DavidM - 01-09-2022, 02:34 PM
RE: Emu48 Edit a CSV File - DavidM - 01-10-2022, 10:50 AM
RE: Emu48 Edit a CSV File - MNH - 01-09-2022, 08:39 PM
RE: Emu48 Edit a CSV File - rprosperi - 01-10-2022, 04:01 AM
RE: Emu48 Edit a CSV File - DavidM - 01-10-2022 12:41 PM
RE: Emu48 Edit a CSV File - DavidM - 01-14-2022, 04:25 PM
RE: Emu48 Edit a CSV File - MNH - 01-15-2022, 07:34 PM
RE: Emu48 Edit a CSV File - MNH - 01-04-2022, 11:06 PM
RE: Emu48 Edit a CSV File - John Keith - 12-31-2021, 06:51 PM
RE: Emu48 Edit a CSV File - MNH - 12-31-2021, 07:58 PM
RE: Emu48 Edit a CSV File - MNH - 01-04-2022, 11:39 PM
RE: Emu48 Edit a CSV File - Eric Rechlin - 01-05-2022, 03:22 PM
RE: Emu48 Edit a CSV File - MNH - 09-04-2022, 09:56 PM



User(s) browsing this thread: 1 Guest(s)