Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 22 JAN 2003 09:09:23AM Oystein Reigem wrote:

Is there a Basic+ function that can substitute values for placeholders ("%1", "%2", etc) in a string?

- Oystein -


At 22 JAN 2003 11:37AM Richard Hunt wrote:

Oystein,

The only one I know is the "SWAP" statement.

SWAP "%1" WITH SOMETHING IN VARIABLE


At 22 JAN 2003 12:00PM [url=http://www.sprezzatura.com" onMouseOver=window.status= Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

Oy

Function SwapValues(Original, Arguments)

CopyOfOriginal=Original

NoOfArgs=Count(Arguments, @Fm) + (Arguments # "")

For LoopPtr=1 To NoOfArgs

Swap "%": LoopPtr: "%" With Arguments in CopyOfOriginal

Next

Return CopyOfOriginal

The Sprezzatura Group

World Leaders in all things RevSoft


At 22 JAN 2003 05:22PM Oystein Reigem wrote:

Sprezz,

Sorry - already made one myself. :-)

But I see yours is a pro version, using a %n% syntax, allowing more than 9 arguments. :-)

- Oystein -


At 22 JAN 2003 05:27PM Oystein Reigem wrote:

Richard,

I read about such a function recently. Perhaps it's a Python function. I'm learning Python now because I'll teach Python this spring. It's my 12th or 13th programming language. Phew. I've lived too long. :-)

- Oystein -


At 23 JAN 2003 04:25AM [url=http://www.sprezzatura.com" onMouseOver=window.status= Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

You only need to be bitten once ;-)

The Sprezzatura Group

World Leaders in all things RevSoft


At 23 JAN 2003 02:50PM Oystein Reigem wrote:

I'd like to see a real-life example of a string with more than 9 placeholders… :-)

- Oystein -


At 23 JAN 2003 08:14PM Richard Hunt wrote:

Oystein,

Now you got me confused… ummm… hmmm….

The "SWAP" statement is an AREV and an OI statement. ???

What is Python?


At 24 JAN 2003 03:05AM Oystein Reigem wrote:

Richard,

Python is a programming language.

Just meant to say I was quite certain I recently read about a function to swap in values for placeholders, but the explanation could be the function was a Python function and not a Basic+ function. I'm currently learning Python in connection with some other part of my work.

Then I went further off on that tangent…

I did end up using the SWAP statement, coding in a similar way to the snippet Sprezz offered.

- Oystein -

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/52ca1ccf4675208685256cb6004dc3cc.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1