Solved

Old lotus macro

Posted on 2004-04-01
4
452 Views
Last Modified: 2008-09-25

I've been asked to decipher a number of lotus macros authored in lotus 1-2-3

It's the standard joke.  The macros have been relied upon so long, that no one knows how
to generate the report without it. (and of course the original author is long gone and
didn't bother to document anything)

Here's a smattering of code.  Could someone tell me somthing about it?
Does it look like someone wrote it? or did someone just hit the record button?

I was told that it was written with a old version of Lotus 1-2-3 (v3.1),
but the file extensions are .wk4 's and run in Lotus 1-2-3 v5a




\0      {GOTO}AAA~{D 4}                              
      {APP-STATE "maximize"}                              
                                    
\G      {HOME}{GOTO}BBB~                              
      {PANELOFF}{WINDOWSOFF}                              
      /WGDOUDQ                              
      /FDg:\lad~                              
      /REC:C3.C:J599~                              
      /REB:A2.B:J4500~                              
      {GOTO}COUNTER3~                              
      1~                              
      {GOTO}COUNTER9~                              
      0~                              
      {GOTO}C6ENTRYA~                              
      +B:A2="LN"#OR#B:A2="BB"#OR#B:A2="BR"#OR#B:A2="LC"#OR#B:A2="SB"~                              
      {GOTO}C6ENTRY~                              
      @LEFT(B:C2,1)="0"#OR#@LEFT(B:C2,1)="1"#OR#@LEFT(B:C2,1)="7"#OR#@LEFT(B:C2,1)="9"~                              
      {GOTO}C:C3~                              
      /RNCTEMP9~~                              
      {GOTO}B:A2~                              
      {getlabel "INPUT AS OF DATE",FILE}                              
TEST      {LET d:A29,+"I:\015RPTS\sf"&FILE}                              
I:\015RPTS\sfTEST      /fccna3..i5000~{ESC}{ESC}{FULL}~                              
      {EDIT-GOTO "B:G2";;"RANGE"}                              
      /WIC~                              
      @IF(F2="AUD",1/H2,H2)~                              
      /C~.{END}{D}{L}{END}{U}{R}~                              
      /RV{END}{D}~{R}~                              
      /WDC~                              
      /WIC~                              
      @IF(F2="EUR",1/H2,H2)~                              
      /C~.{END}{D}{L}{END}{U}{R}~                              
      /RV{END}{D}~{R}~                              
      /WDC~                              
      /RFF5~{END}{D}~                              
      {EDIT-GOTO "B:D2";;"RANGE"}                              
      /WIC~                              

------------ snip ------------------
0
Comment
Question by:Marketing_Insists
  • 3
4 Comments
 
LVL 45

Accepted Solution

by:
patrickab earned 300 total points
Comment Utility
\0                                           This is an automacro that executes when the file is opened
\0     {GOTO}AAA~{D 4}           Go to named range AAA and the move down 5 cells          
     {APP-STATE "maximize"}     Maximise the window for the applicaton                  
                             
\G     {HOME}{GOTO}BBB~               Go to A1 in the sheet and then go to range named BBB          
     {PANELOFF}{WINDOWSOFF}       Turn the lotus command line off and turn off the screen up-date whilst the macro is running - it speeds up the macro
     /WGDOUDQ                         This line turns off the undo facility
     /FDg:\lad~                          Change directory to g:\lad
     /REC:C3.C:J599~                 Range erase C:A2 to J599
     /REB:A2.B:J4500~                Range erase B:A2 to BJ4500        
     {GOTO}COUNTER3~             Go to range named COUNTER3            
     1~                                       Enter the value 1
     {GOTO}COUNTER9~             Go to range named COUNTER9        
     0~                                       Enter the value 0
     {GOTO}C6ENTRYA~              Go to range named C6ENTRYA
     +B:A2="LN"#OR#B:A2="BB"#OR#B:A2="BR"#OR#B:A2="LC"#OR#B:A2="SB"~     - sorry don't understand this line                    
     {GOTO}C6ENTRY~                Go to named range C6ENTRY
     @LEFT(B:C2,1)="0"#OR#@LEFT(B:C2,1)="1"#OR#@LEFT(B:C2,1)="7"#OR#@LEFT(B:C2,1)="9"~                        
     {GOTO}C:C3~                         Go to C:C3
     /RNCTEMP9~~                        Range Name Create TEMP9
     {GOTO}B:A2~                         Go to B:A2
     {getlabel "INPUT AS OF DATE",FILE}                 This is meant to open a dialogue box and allow the user to enter some information but it has been written incorrectly.        
TEST     {LET d:A29,+"I:\015RPTS\sf"&FILE}      Enters I:\015RPTS\sf and the adds FILE to to the string - I assume it is to be able to give a new file name.  The word TEST at the beginning of the line doesn't make sense at the moment.                    
I:\015RPTS\sfTEST     Not sure how this works in the macro
/fccna3..i5000~{ESC}{ESC}{FULL}~          File combine copy named range A3 to i5000 - not usre what the FULL means        
     {EDIT-GOTO "B:G2";;"RANGE"}     Goto and edit range B:G2 by selecting the whole  RANGE - seems a rather unnecessary thing to do!
     /WIC~                     Insert a column    
     @IF(F2="AUD",1/H2,H2)~                If A2=AUD put 1/H2 else put H2        
     /C~.{END}{D}{L}{END}{U}{R}~        Go to the end of the column by going to the bottom of the spreadsheet, moving left one column, going up to the top to the column and the moving one column to the right                    
     /RV{END}{D}~{R}~      Change the entries in the highlighted area to values.                  
     /WDC~              Delete the column containing the cursor          
     /WIC~                Insert a column        
     @IF(F2="EUR",1/H2,H2)~      If F2=EUR then enter 1/H2 else enter H2
     /C~.{END}{D}{L}{END}{U}{R}~   Copy the highlighted range                      
     /RV{END}{D}~{R}~                    Change the entries of the highlighted range to values instead of formulas    
     /WDC~                                      Delete a column
     /RFF5~{END}{D}~                      Format the highlighted range to 5 decimal places  
     {EDIT-GOTO "B:D2";;"RANGE"}    Go to and edit B:D2
     /WIC~                                       Insert a column

----------------

Can't imagine this helps at all but there you go! Good luck..

0
 
LVL 45

Expert Comment

by:patrickab
Comment Utility
Oh to answer your question - it was almost definitely written by hand. It would not be possible to put in the logical stuff by just recording a macro. It is possible to record a large part and then edit it but somehow I doubt that was how it was done.

By the way the following:

 +B:A2="LN"#OR#B:A2="BB"#OR#B:A2="BR"#OR#B:A2="LC"#OR#B:A2="SB"~     - sorry don't understand this line

It clear as to its logic but I don't understand what it is really doing. I think it's a problem of not knowing the context. The next line attempts to edit the line result of the line above if the B:A2 contains certain characters. The line is:

@LEFT(B:C2,1)="0"#OR#@LEFT(B:C2,1)="1"#OR#@LEFT(B:C2,1)="7"#OR#@LEFT(B:C2,1)="9"~

When extracted and run as mini macro these two lines don't appear to do very much. Try it and you'll see.

Now the line:

TEST     {LET d:A29,+"I:\015RPTS\sf"&FILE}

Is it quoted by you slightly ambiguously? I think you will find that TEST is a named range to the left of {LET d:A29,+"I:\015RPTS\sf"&FILE}. If it isn't then I don't know how it works!

0
 

Author Comment

by:Marketing_Insists
Comment Utility
Thanks!  I now have hope.

Though can you believe their is another 2000 lines of this?


Any way, your input gives me a nice head start
0
 
LVL 45

Expert Comment

by:patrickab
Comment Utility
Many thanks for the points and the A grade.

Years ago I bought a very useful book on Lotus123 called "Using Lotus 123" published by Que in believe it or not 1985 -  I bought my copy almost exactly 21 years ago in 1987! Specifically it is ISBN 0-88022-243-3 and is written by Geoffrey T LeBlond and Douglas Ford Cobb. I reckon you might be able to find on Amazon for relatively little as it is so out of date or perhaps something a bit more up-to-date as the macro language changed as the newer editions of Lotus 123 became available.

2000 lines is a lot and very tiresome indeed.

I have no idea about your application but I would care to bet that if you re-thought it and put it into a database such as Lotus Approach which has acceptable reporting tools (considering how inexpensive it is) you might find the whole application much easier to re-implement.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Notes 8.5.2 application on web 4 199
Recent Contacts - Lotus Notes 10 601
Lotus Notes 8.5 1 137
Lotus Notes Database "Invalid NSF Version" 5 1,609
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now