Procedure no longer works


#1

Hello Friends,
I have a data base that I converted from Pan6 and my duplicate record procedure no longer works the way it used to. If I clicked on the duplicate button it would come up with a dialog asking how many I wanted to duplicate. It still works except it only duplicates two records even though I put in the number 10. Below is the procedure. Do you see anything that would keep it from working in Pan X?

GLOBAL Test
GetScrap "Number to Duplicate?"
Test=Clipboard()
IF VAL(Test)=1
CopyRecord
PasteRecord
DownRecord
Field «First Name»
ClearCell
Field «Last Name»
ClearCell
SuperObject “First Name”,"Open"
ELSE
CopyRecord
PasteRecord
DownRecord
Field «First Name»
ClearCell
Field «Last Name»
ClearCell
CopyRecord
Loop
PasteRecord
Until VAL(Test)-1
;Window “Show All Windows”
;SHOW
SuperObject “First Name”,"Open"
ENDIF


#2

In Pan X, the formula in the Until statement must produce a true or false result. Any number other than zero will be regarded as true, and stop the loop.

You can still use an explicit number like

until 8

but not a formula like you are using. You could try this

Local Test
Test = "1"
GetText "Number to Duplicate?", Test
IF VAL(Test)=1
    CopyRecord
    PasteRecord
    DownRecord
    Field «First Name»
    ClearCell
    Field «Last Name»
    ClearCell
    SuperObject "First Name","Open"
ELSE
    CopyRecord
    PasteRecord
    DownRecord
    Field «First Name»
    ClearCell
    Field «Last Name»
    ClearCell
    CopyRecord
    For Counter,1,val(Test)-1
        PasteRecord
    EndLoop
    ;Window "Show All Windows"
    ;SHOW
    SuperObject "First Name","Open"
ENDIF

I replaced GetScrap with GetText, so you aren’t messing with the clipboard, and changed Test from a global to a local, because it’s unlikely to be needed once the procedure ends. The For loop is a new feature in Pan X, and a very handy way to write a loop where you want to count the number of repetitions.


#3

Thanks as always for the good community support.
It worked just fine.

BTW: Is there a list of statements that worked in Pan6 and have been replaced by another name in PanX?


#4

The list of statements and functions below lists the old and new names. By the way, the OLD names should still work (though I didn’t test all of these just now). However, these statements and functions are now listed under the new names in the documentation.

activesuperobject,activeobject
arraymenu(,arraymenuitems(
bigmessage,message
cautionalert,stopalert
checkedarraymenu(,checkedarraymenuitems(
columnmenu(,menu(
columnsubmenu(,submenu(
editmenu(,menu(
filetrash,fileerase
giantmessage,message
grabdata(,fieldvalue(
grabfilevariable(,fileglobalvalue(
grabwindowvariable(,windowglobalvalue(
importoneline,importline
info(“availablescreenrect”),info(“availablescreenrectangle”)
listdictionarynames(,listdictionarykeys(
makenewfolder,makefolder
naturaldatepattern(,naturaldate(
next,nextmatch
notealert,alert
pathid(,folder(
pathstr(,folderpath(
plainalert,alert
returnkey,insertbelowcarriagereturn
rtn,return
rtnerror,returnerror
rudemessage,message
shellopendocument,openurl
superobject,objectaction
superobjectclose,closeactiveobject
tallmessage,message
textfilter,textfilter(


#5

Thank You as always Jim.

My day would be complete when spacing for objects comes back in.

Blessings,

– Jerry Jambazian, (Treasurer, Administrator and Webmaster)

Christian Ministries Training Association
Sponsors of the annual IMPACT Convention
Serving the local church since 1952
PO Box 1500
Temple City, CA 91780-7500
(626) 286-6492
Cell Phone (626) 643-9460

e-mail: cmta@earthlink.net
www: http://www.cmtaconvention.org