[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [Dynamic Variables?]



Hi !!

Hmm.... some nice quiz question here!! I don't think there are "Dynamic
Variables" in SQR, but there are ways to simulate this problem.

I would prefer making a calculated guess here..... assuming that your Vendor
Name will not have more than 10 words in it simply because names aren't that
long! :o)

In this case, what we can do is.... create an array of size 10, and use it in
the unstring function.
unstring function would looks like :

UNSTRING $vendorName BY ' ' INTO splitWords.vendorName(1)
splitWords.vendorName(2) splitWords.vendorName(3) ...
splitWords.vendorName(10)

In case there are extra destination array elements, then the unsrting will
leave them as empty strings.... so they won't really matter, other than eating
some memory. It's not a big overhead.
Just make sure you use the function 
CLEAR-ARRAY name=splitWords 
each time you run this UNSTRING function.

Does this sound practical ?! I think this is an optimum solution I would opt
for.

HTH,
Vishal Nayak.

owner-sqr-users@list.iex.net wrote:
Is there a way to dynamically assign variables using SQR, for example, I
have to find where all of the spaces are in a vendor name .. i.e.
A G Prada Inc.
Mark Associates
A A A Locksmith Inc

All of these have a different amount of spaces in them, so I assume that
a normal instr will not work.

This is why I would dynamically set a variable, to catch all the spaces in
a file, and then use the results to do certain substr() from there.  Hope I
made that understandable.  thanks

Mark Kraft
kraftm@gunet.georgetown.edu


____________________________________________________________________
More than just email--Get your FREE Netscape WebMail account today at http://home.netscape.com/netcenter/mail