In Panorama X grabdata( and fieldvalue( are synonyms – you can use either and they work identically. But if you look in the documentation, it is listed under fieldvalue(. This change is strictly because I think fieldvalue( is a name that makes it much clearer than grabdata( that what this function does is get the value from a field.
The suggestions by Gary and Kurt are excellent, and more in line with how I would program things. But to directly answer your question, the clipboard is essentially an un-named variable, so you can one-for-one replace it with an explicitly declared variable. Here is a code that is just like yours but using a variable (which I called temp) instead of the clipboard.
local temp
Window "Membership File:Youth/Children Choir"
temp = «ID Number»
Window "TEST:TRIP"
BID01 = temp
Window "Membership File:Youth/Children Choir"
temp = FName
Window "TEST:TRIP"
FName01 = temp
Window "Membership File:Youth/Children Choir"
temp = LName
Window "TEST:TRIP"
LName01 = temp
Since you can set up as many variables as you want, you can reduce the back and forth between windows, in fact, by using 3 variables you can just flip over to the other window once and back.
local tempID,tempFName,tempLName
Window "Membership File:Youth/Children Choir"
tempID = «ID Number»
tempFName = FName
tempLName = LName
Window "TEST:TRIP"
BID01 = tempID
FName01 = tempFName
LName01 = tempLName
Usually to avoid using the clipboard you need to use a variable instead. However, in this case, you can make the whole thing a lot simpler because all the data is readily available in the current record in each database and can be directly accessed with the grabdata( function (or fieldvalue( in Panorama X). I’m going to assume that the “TEST:TRIP” window is already active, then the entire task can be done in three lines of code, with no back and forth of windows!
BID01 = grabdata("Membership File","ID Number")
FName01 = grabdata("Membership File","FName")
LName01 = grabdata("Membership File","LName")
I’ve put the field names in the grabdata( function in quotes, but you can also do it as Gary did above (my last example is pretty much identical to Gary’s), without the quotes (but then chevrons are required for ID Number
).