REVG: Need subroutine to find "D2/" in files (AREV Specific)
At 20 DEC 1999 10:50:18AM Steve C. wrote:
I need a subroutine that will browse through RevG files and find
"D2/" strings. Can anyone help??
TIA
Steve C.
At 20 DEC 1999 11:43AM CT Savell wrote:
There are number of ways to do this. The first one to come to mind is to:
1) Open the file
2) Loop on all records in the file not starting with '$'
3) Read the record
4) IF INDEX(RECORD,'D2/',1) THEN store the @id in a temp file or TEXT the record, etc.
5) If you wanted to substitute another format you could use SWAP to do so.
Tom
At 20 DEC 1999 11:52AM Mark Ford wrote:
We have a program called CISFIND that is a modified version of a FIND routine originally developed for earlier versions of AREV. I believe this routine can help you.
Send me your email address and we will send you a copy.
Mark
At 20 DEC 1999 02:14PM Kurt wrote:
The lazy man approach this is to create a symbolic dictionary item in your VOC file- say call it 'findd2' and write the following program:
x=@record
convert @lowercase to @uppercase in x
if index(x,'D2/',1) then
@ans=1end else
@ans=0end
Then you can just say
SELECT WHATEVERFILE with FINDD2
and bingo you have an active select of all records that meet the criteria - then you can savelist for further processing.
Signed,
One Lazy Programmer
At 20 DEC 1999 02:42PM Capt'n Kirk wrote:
An even 'lazier' man's approach
Using the same idea make it general instead of specific. I have a VOC record called RECORD with the formula
@ANS=@RECORD
That returns the entire record, so an RList statement to find all occurances of 'D2/' would be
:SELECT DICT filename WHEN RECORD CONTAINS "D2/"
This will now work on any file, any record, and value to search for. If there is object code as well then use the keyword SOURCE to eliminate them from your select list. If you do not have an edit pattern of '%LC%' then @ANS will return in all uppercase so there is no need to convert in the formula (@lowercase & @uppercase are not in RevG anyway).
For case specific searches I have a similar record LCRECORD with the edit pattern '%LC%" specified.
At 20 DEC 1999 02:45PM Steve C. wrote:
Thanks to all of ya'll. I got what I needed with the Index function.
Although I'm trying to get out a replacement OI program in time…
.. as time runs out I may have to do a quick temporary fix for the
RevG program that's been in place since 1985.
Thanks…. again.
Steve C.
At 20 DEC 1999 02:49PM Kurt wrote:
Uncle - you win. My dream of being a programmer has just been crushed -back to selling….
![]()
Kurt
At 20 DEC 1999 04:38PM CT Savell wrote:
WOW, I like it.
Why didn't I think of that? (Don't answer)
At 20 DEC 1999 06:59PM Mike Ruane, WinWin Solutions Inc wrote:
Guys-
That functionality is already built in, I think.
SELECT filename WITH ALL 'D2/'
At least Arev, and OI. I can't remember RevG.
Mike Ruane
WinWin Solutions Inc.
At 21 DEC 1999 12:30AM Warren wrote:
Certainly lazy, as the RevG compiler doesn't support lower case characters nor do the system variable @UPPERCASE and @LOWERCASE exist in Revelation.
At 21 DEC 1999 09:25AM Kurt wrote:
Warren,
re: @uppercase/@lowercase
Sorry, but its been 14 years…
At 21 DEC 1999 11:37AM [email protected] - [url=http://www.sprezzatura.com]Sprezzatura Group[/url] wrote:
Still, not bad for a sales guy. So, you ready for a quiz, see how good the ole memory is? Lay you 10-1 you'd beat out over half the regulars.
[/i]World leaders in all things RevSoft[/i]
At 21 DEC 1999 11:47AM CT Savell wrote:
No, ALL is not valid in REVG
At 21 DEC 1999 02:56PM Warren wrote:
S'kay, I still mix up Pick and Prime InfoBasic commands and syntax once in a while and that's going on 19-20 years…
A tribute to the Power of the Revelation environment that apps written so long ago are still in use.
As well as finding the lowest Revelation Serial # maybe try the find the oldest existing Revelation app still in use? (Don't tell my RTI's mailing list is still in Rev…)
At 06 JAN 2000 06:38PM Victor Engel wrote:
What about LINES?
At 06 JAN 2000 07:39PM CT Savell wrote:
No, LINES is not preset either. Your best bet is to create a new dictionary item in the VOC file called RECORD and set @ANS=@RECORD.
Then you can:
SELECT WITH RECORD 'D2/'
Thank the great Emu for that piece of genius.
Tom
At 07 JAN 2000 08:56AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Been so long since RevG was part of our daily lives here at Sprezz, but since ALL and LINES are just symbolics in VOC, why not just add them to RevG?
[/i]World leaders in all things RevSoft[/i]