Dan and Bob,
Here is a suggestion on how to make you code modre efficient.SET VAR vLoopCount 
INTEGER
SET VAR vmsg TEXT
COMPUTE vLoopCount AS COUNT partnumber FROM master WHERE partnumber IS NOT NULL

DECLARE cursor1 CURSOR FOR SELECT ('Part ->' & partnumber) FROM master +
  WHERE partnumber IS NOT NULL ORDER BY partnumber ASC
WHILE vLoopCount > 0 THEN
 FETCH cursor1 INTO vmsg IND vi1
 PROPERTY textmessage CAPTION .vmsg
 PROCESSMESSAGE
 SET VAR vLoopCounter = (.vLoopCounter - 1)
ENDWHILE
RETURN
1. Precalculate the number of records to process2. Do calculations or data 
manipulation in the cursor definition instead within the loop3. Using the 
indicated while syntax the loop will not execute if no drecords are available4. 
The WHILE state will better optimize


Jim Bentley, American Celiac Society 1-504-305-2968
      From: Dan Goldberg <[email protected]>
 To: [email protected] 
 Sent: Wednesday, August 19, 2015 5:52 PM
 Subject: [RBASE-L] - Re: Static text caption
   
 <!--#yiv7422763869 _filtered #yiv7422763869 {font-family:Calibri;panose-1:2 15 
5 2 2 2 4 3 2 4;} _filtered #yiv7422763869 {font-family:Tahoma;panose-1:2 11 6 
4 3 5 4 4 2 4;} _filtered #yiv7422763869 {font-family:Consolas;panose-1:2 11 6 
9 2 2 4 3 2 4;}#yiv7422763869 #yiv7422763869 p.yiv7422763869MsoNormal, 
#yiv7422763869 li.yiv7422763869MsoNormal, #yiv7422763869 
div.yiv7422763869MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New 
Roman", "serif";}#yiv7422763869 a:link, #yiv7422763869 
span.yiv7422763869MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv7422763869 a:visited, #yiv7422763869 
span.yiv7422763869MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv7422763869 pre 
{margin:0in;margin-bottom:.0001pt;font-size:10.0pt;font-family:"Courier 
New";}#yiv7422763869 tt {font-family:"Courier New";}#yiv7422763869 
p.yiv7422763869MsoAcetate, #yiv7422763869 li.yiv7422763869MsoAcetate, 
#yiv7422763869 div.yiv7422763869MsoAcetate 
{margin:0in;margin-bottom:.0001pt;font-size:8.0pt;font-family:"Tahoma", 
"sans-serif";}#yiv7422763869 span.yiv7422763869HTMLPreformattedChar 
{font-family:Consolas;}#yiv7422763869 span.yiv7422763869BalloonTextChar 
{font-family:"Tahoma", "sans-serif";}#yiv7422763869 
span.yiv7422763869EmailStyle22 {font-family:"Calibri", 
"sans-serif";color:#1F497D;}#yiv7422763869 span.yiv7422763869EmailStyle23 
{font-family:"Calibri", "sans-serif";color:#1F497D;}#yiv7422763869 
.yiv7422763869MsoChpDefault {font-size:10.0pt;} _filtered #yiv7422763869 
{margin:1.0in 1.0in 1.0in 1.0in;}#yiv7422763869 div.yiv7422763869WordSection1 
{}-->I found a couple of things. The & was missing from the  ('Part -> ' & 
.vpart) (probably from retyping)    I put in processmessage and that seemed to 
help on the display refresh. I had 10,000 part numbers but only saw about 40 
because it was going so fast.    Here is a modified one that I tried from my 
database.    DECLARE cursor1 CURSOR FOR SELECT partnumber FROM master ORDER BY 
partnumber OPEN cursor1 FETCH cursor1 INTO vpart IND vi1 WHILE SQLCODE <> 100  
THEN   SET VAR vmsg = ('Part -> ' & .vpart)   PROPERTY textmessage CAPTION  
.vmsg   processmessage   FETCH cursor1 INTO vpart IND vi1 ENDWHILE DROP CURSOR 
cursor1 RETURN    Dan Goldberg    From: [email protected] 
[mailto:[email protected]]On Behalf Of Bob Thompson
Sent: Wednesday, August 19, 2015 2:30 PM
To: Dan Goldberg
Subject: [RBASE-L] - Re: Static text caption    I am glad Dan replied as I do 
not see Karen's posts!    The syntax in the actual code is correct,  I typed 
this from my phone.  (Fingers too big!).      I am fairly sure it has to do 
with the speed of the loop.   However, I need to give some feedback to the 
user.  However I do not want to put a pause command and slow the process down.  

 Bob Thompson LaPorte, IN 219-363-7441    Sent from my iPod 
On Aug 19, 2015, at 4:12 PM, Dan Goldberg <[email protected]> wrote: 
There is.   Dan Goldberg     From:[email protected] 
[mailto:[email protected]]On Behalf Of Karen Tellef
Sent: Wednesday, August 19, 2015 2:11 PM
To: Dan Goldberg
Subject: [RBASE-L] - Re: Static text caption   Is it just the email message, or 
is there really a space between ". vMsg"?

Karen       -----Original Message-----
From: Bob Thompson <[email protected]>
To: karentellef <[email protected]>
Sent: Wed, Aug 19, 2015 4:05 pm
Subject: [RBASE-L] - Static text caption   I have a form eep that runs a WHILE 
loop for several thousand records.     In this WHILE loop,  I have a PROPERTY 
command that sets a static text caption to a variable value.    The caption 
does not update on the form when the eep fires.     While .......  Then   
(Other coding)   Set Var vMsg = ('Part -> ' + .vPart) Property TextMessage 
caption  . vMsg   (More code)   EndWhile     I have used similar statements 
above many times in eeps with no problem.   However in this WHILE loop, I 
cannot get the caption to refresh.     I have tried various refresh and recalc 
commands but to no avail.   The loop runs fairly fast, but I would think the 
caption would at least occasionally update.       Any ideas?    Thanks   Bob 
Thompson LaPorte, IN 219-363-7441   Sent from my iPod   On Aug 19, 2015, at 
3:10 PM, "A. Razzak Memon" <[email protected]> wrote:   > At 02:30 PM 8/19/2015, 
Dan Goldberg wrote: >    >> I want to copy data from one table into another 
table. The problem is >> I have one column in the destination that is an 
autonumber field. >>  >> I want to put the number from the source table in that 
autonumber field >> as I have already captured it using the nextnum function. 
>>  >> Other than using unload/load does anybody know a way to achieve this? >  
>  > Dan, >  >  There are many techniques to achieve your goal to APPEND data 
from > one table to another with AUTONUM column. >  > Here's a very simple 
technique ... >  >  Steps: >  > 01. Before attempting to APPEND data from one 
table to another table, >    use the following command for the "Target" table: 
>  >    AUTONUM ColumnName IN TargetTable DELETE >  > 02. Now APPEND the data 
from source table to target table >  >    APPEND SourceTable TO TargetTable >  
> 03. Re-Assign the AutoNum for column in TargetTable >  >    SET VAR vMaxValue 
INTEGER = 0 >    SELECT (MAX(ColumnName)) INTO vMaxValue INDIC iv1 FROM 
TargetTable >    AUTONUM ColumnName IN TargetTable USING .vMaxVallue 1 NUM >   
CLEAR VARIABLES iv1,vMaxValue >    RETURN >  > Hope that helps! >  > Feel free 
to reach out to me with any questions. >  > Very Best R:egards, >  >  Razzak. > 
 > www.rbase.com > www.rbaseX.com > www.facebook.com/rbase > --   > 32 years of 
continuous innovation! > 17 Years of R:BASE Technologies, Inc. making R:BASE 
what it is today! > --  >  >      


  

Reply via email to