4GL eample please!

Not for Each however FIND does throw an error if something ins't found
unless you run with NO-ERROR flag


*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*


On Fri, Jul 5, 2013 at 1:55 PM, Dan Godfrey <dgodfrey@...> wrote:

> **
>
>
> Ok, thanks. I wasn't sure if it ran with a bllind index value on the table
> records.
>
> Dan Godfrey
> (805) 389-1935 x 251
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of Jose Gomez
> Sent: Friday, July 05, 2013 10:39 AM
> To: Vantage
> Subject: Re: [Vantage] 4GL eample please!!
>
> FOR EACH loop runs on "EACH" record if there are none it doesn't run
> that's not your problem.
>
> *Jose C Gomez*
> *Software Engineer*
> *
> *
> *
> *T: 904.469.1524 mobile
> E: jose@...
> http://www.josecgomez.com
> <http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez
> >
> <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
> <http://www.josecgomez.com/professional-resume/>
> <http://www.josecgomez.com/feed/>
> <http://www.usdoingstuff.com>
>
> *Quis custodiet ipsos custodes?*
>
>
> On Fri, Jul 5, 2013 at 1:32 PM, dgodfrey_amc <dgodfrey@...> wrote:
>
> > **
>
> >
> >
> > I am looking for an example on how to identify if a record exist in a
> > table before I do a for loop with a condition on it.
> >
> > I have an Pre-Processing BPM on the PO.Update method. I am getting an
> > ERROR in the log file. It just says "-- TRACE: SINGLE-RUN Procedure
> > END ERROR. (8458)" I think it is that there are no ttPORel records
> > when I am doing the for loop on ttPORel.
> >
> > Here is my 4gl code:
> >
> > define variable vFrom as character no-undo initial '':U.
> > define variable vTo as character no-undo initial '':U.
> > define variable vCC as character no-undo initial '':U.
> > define variable vSubject as character no-undo initial '':U.
> > define variable vBody as character no-undo initial '':U.
> > define variable hEmailEx as handle no-undo.
> > define variable index_cnt as integer no-undo.
> >
> > index_cnt = 0.
> > run Bpm/BpmEmail.p persistent set hEmailEx.
> >
> > for each ttPORel where (ttPORel.PromiseDt = ? OR
> > string(ttPORel.PromiseDt) = ""):
> > Assign ttPORel.PromiseDt = ttPORel.DueDate.
> > if(ttPORel.RowMod = "") then do:
> > Assign ttPORel.RowMod = "U".
> > End.
> > index_cnt = index_cnt + 1.
> > assign vFrom = vFrom +
> > 'dgodfrey@... <%26%2339%3Bdgodfrey%40a-m-c.com>
> <%26%2339%3Bdgodfrey%40a-m-c.com>
> > '.
> > assign vTo = vTo + 'dgodfrey@... <%26%2339%3Bdgodfrey%40a-m-c.com><%26%2339%3Bdgodfrey%
> 40a-m-c.com>'.
>
> > assign vCC = vCC + ''.
> > assign vSubject = vSubject + 'BPM: Purchase Order Update Method(' +
> > string(index_cnt) + ')'.
> > assign vBody = vBody + 'PO# ' + string(ttPORel.PONum).
> > assign vBody = vBody + '~nLine# ' + string(ttPORel.POLine).
> > assign vBody = vBody + '~nRel# ' + string(ttPORel.PORelNum).
> > assign vBody = vBody + '~nPO Order Date ' + string(ttPOHeader.OrderDate).
> > assign vBody = vBody + '~nPORel.PromiseDt ' + string(ttPORel.PromiseDt).
> > assign vBody = vBody + '~nPORel.DueDate ' + string(ttPORel.DueDate).
> > assign vBody = vBody + '~nEntered by ' + string(DCD-USERID) .
> >
> > /*MESSAGE vBody.*/
> > run SendEmail in hEmailEx (
> > false,
> > CUR-COMP,
> > vFrom,
> > vTo,
> > vCC,
> > vSubject,
> > vBody,
> > "":U
> > ).
> >
> > if valid-handle(hEmailEx) then delete procedure hEmailEx.
> > leave.
> > end.
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
> already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
> CONFIDENTIALITY NOTICE: The data attached/enclosed may contain information
> (including technology and technical data) which is subject to the U.S.
> International Traffic in Arms Regulations (ITAR) or Export Administration
> Regulations (EAR). This information may not be exported, released, or
> disclosed to foreign persons either inside or outside the United States
> without first obtaining the proper U.S. export license or written
> authorization. In addition, the information and articles described herein
> are either patented or proprietary, and the copying or reproduction thereof
> is prohibited without ADVANCED Motion Controls prior written consent. If
> you are not the intended recipient (or have received this e-mail in error),
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden. Thank you for your compliance.
>
>
>


[Non-text portions of this message have been removed]
I am looking for an example on how to identify if a record exist in a table before I do a for loop with a condition on it.

I have an Pre-Processing BPM on the PO.Update method. I am getting an ERROR in the log file. It just says "-- TRACE: SINGLE-RUN Procedure END ERROR. (8458)" I think it is that there are no ttPORel records when I am doing the for loop on ttPORel.

Here is my 4gl code:

define variable vFrom as character no-undo initial '':U.
define variable vTo as character no-undo initial '':U.
define variable vCC as character no-undo initial '':U.
define variable vSubject as character no-undo initial '':U.
define variable vBody as character no-undo initial '':U.
define variable hEmailEx as handle no-undo.
define variable index_cnt as integer no-undo.

index_cnt = 0.
run Bpm/BpmEmail.p persistent set hEmailEx.

for each ttPORel where (ttPORel.PromiseDt = ? OR string(ttPORel.PromiseDt) = ""):
Assign ttPORel.PromiseDt = ttPORel.DueDate.
if(ttPORel.RowMod = "") then do:
Assign ttPORel.RowMod = "U".
End.
index_cnt = index_cnt + 1.
assign vFrom = vFrom + 'dgodfrey@...'.
assign vTo = vTo + 'dgodfrey@...'.
assign vCC = vCC + ''.
assign vSubject = vSubject + 'BPM: Purchase Order Update Method(' + string(index_cnt) + ')'.
assign vBody = vBody + 'PO# ' + string(ttPORel.PONum).
assign vBody = vBody + '~nLine# ' + string(ttPORel.POLine).
assign vBody = vBody + '~nRel# ' + string(ttPORel.PORelNum).
assign vBody = vBody + '~nPO Order Date ' + string(ttPOHeader.OrderDate).
assign vBody = vBody + '~nPORel.PromiseDt ' + string(ttPORel.PromiseDt).
assign vBody = vBody + '~nPORel.DueDate ' + string(ttPORel.DueDate).
assign vBody = vBody + '~nEntered by ' + string(DCD-USERID) .

/*MESSAGE vBody.*/
run SendEmail in hEmailEx (
false,
CUR-COMP,
vFrom,
vTo,
vCC,
vSubject,
vBody,
"":U
).

if valid-handle(hEmailEx) then delete procedure hEmailEx.
leave.
end.
FOR EACH loop runs on "EACH" record if there are none it doesn't run that's
not your problem.


*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*


On Fri, Jul 5, 2013 at 1:32 PM, dgodfrey_amc <dgodfrey@...> wrote:

> **
>
>
> I am looking for an example on how to identify if a record exist in a
> table before I do a for loop with a condition on it.
>
> I have an Pre-Processing BPM on the PO.Update method. I am getting an
> ERROR in the log file. It just says "-- TRACE: SINGLE-RUN Procedure END
> ERROR. (8458)" I think it is that there are no ttPORel records when I am
> doing the for loop on ttPORel.
>
> Here is my 4gl code:
>
> define variable vFrom as character no-undo initial '':U.
> define variable vTo as character no-undo initial '':U.
> define variable vCC as character no-undo initial '':U.
> define variable vSubject as character no-undo initial '':U.
> define variable vBody as character no-undo initial '':U.
> define variable hEmailEx as handle no-undo.
> define variable index_cnt as integer no-undo.
>
> index_cnt = 0.
> run Bpm/BpmEmail.p persistent set hEmailEx.
>
> for each ttPORel where (ttPORel.PromiseDt = ? OR string(ttPORel.PromiseDt)
> = ""):
> Assign ttPORel.PromiseDt = ttPORel.DueDate.
> if(ttPORel.RowMod = "") then do:
> Assign ttPORel.RowMod = "U".
> End.
> index_cnt = index_cnt + 1.
> assign vFrom = vFrom + 'dgodfrey@...<%26%2339%3Bdgodfrey%40a-m-c.com>
> '.
> assign vTo = vTo + 'dgodfrey@... <%26%2339%3Bdgodfrey%40a-m-c.com>'.
> assign vCC = vCC + ''.
> assign vSubject = vSubject + 'BPM: Purchase Order Update Method(' +
> string(index_cnt) + ')'.
> assign vBody = vBody + 'PO# ' + string(ttPORel.PONum).
> assign vBody = vBody + '~nLine# ' + string(ttPORel.POLine).
> assign vBody = vBody + '~nRel# ' + string(ttPORel.PORelNum).
> assign vBody = vBody + '~nPO Order Date ' + string(ttPOHeader.OrderDate).
> assign vBody = vBody + '~nPORel.PromiseDt ' + string(ttPORel.PromiseDt).
> assign vBody = vBody + '~nPORel.DueDate ' + string(ttPORel.DueDate).
> assign vBody = vBody + '~nEntered by ' + string(DCD-USERID) .
>
> /*MESSAGE vBody.*/
> run SendEmail in hEmailEx (
> false,
> CUR-COMP,
> vFrom,
> vTo,
> vCC,
> vSubject,
> vBody,
> "":U
> ).
>
> if valid-handle(hEmailEx) then delete procedure hEmailEx.
> leave.
> end.
>
>
>


[Non-text portions of this message have been removed]
Ok, thanks. I wasn't sure if it ran with a bllind index value on the table records.


Dan Godfrey
(805) 389-1935 x 251

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Jose Gomez
Sent: Friday, July 05, 2013 10:39 AM
To: Vantage
Subject: Re: [Vantage] 4GL eample please!!

FOR EACH loop runs on "EACH" record if there are none it doesn't run that's not your problem.


*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*


On Fri, Jul 5, 2013 at 1:32 PM, dgodfrey_amc <dgodfrey@...> wrote:

> **
>
>
> I am looking for an example on how to identify if a record exist in a
> table before I do a for loop with a condition on it.
>
> I have an Pre-Processing BPM on the PO.Update method. I am getting an
> ERROR in the log file. It just says "-- TRACE: SINGLE-RUN Procedure
> END ERROR. (8458)" I think it is that there are no ttPORel records
> when I am doing the for loop on ttPORel.
>
> Here is my 4gl code:
>
> define variable vFrom as character no-undo initial '':U.
> define variable vTo as character no-undo initial '':U.
> define variable vCC as character no-undo initial '':U.
> define variable vSubject as character no-undo initial '':U.
> define variable vBody as character no-undo initial '':U.
> define variable hEmailEx as handle no-undo.
> define variable index_cnt as integer no-undo.
>
> index_cnt = 0.
> run Bpm/BpmEmail.p persistent set hEmailEx.
>
> for each ttPORel where (ttPORel.PromiseDt = ? OR
> string(ttPORel.PromiseDt) = ""):
> Assign ttPORel.PromiseDt = ttPORel.DueDate.
> if(ttPORel.RowMod = "") then do:
> Assign ttPORel.RowMod = "U".
> End.
> index_cnt = index_cnt + 1.
> assign vFrom = vFrom +
> 'dgodfrey@...<%26%2339%3Bdgodfrey%40a-m-c.com>
> '.
> assign vTo = vTo + 'dgodfrey@... <%26%2339%3Bdgodfrey%40a-m-c.com>'.
> assign vCC = vCC + ''.
> assign vSubject = vSubject + 'BPM: Purchase Order Update Method(' +
> string(index_cnt) + ')'.
> assign vBody = vBody + 'PO# ' + string(ttPORel.PONum).
> assign vBody = vBody + '~nLine# ' + string(ttPORel.POLine).
> assign vBody = vBody + '~nRel# ' + string(ttPORel.PORelNum).
> assign vBody = vBody + '~nPO Order Date ' + string(ttPOHeader.OrderDate).
> assign vBody = vBody + '~nPORel.PromiseDt ' + string(ttPORel.PromiseDt).
> assign vBody = vBody + '~nPORel.DueDate ' + string(ttPORel.DueDate).
> assign vBody = vBody + '~nEntered by ' + string(DCD-USERID) .
>
> /*MESSAGE vBody.*/
> run SendEmail in hEmailEx (
> false,
> CUR-COMP,
> vFrom,
> vTo,
> vCC,
> vSubject,
> vBody,
> "":U
> ).
>
> if valid-handle(hEmailEx) then delete procedure hEmailEx.
> leave.
> end.
>
>
>


[Non-text portions of this message have been removed]



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

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



CONFIDENTIALITY NOTICE: The data attached/enclosed may contain information (including technology and technical data) which is subject to the U.S. International Traffic in Arms Regulations (ITAR) or Export Administration Regulations (EAR). This information may not be exported, released, or disclosed to foreign persons either inside or outside the United States without first obtaining the proper U.S. export license or written authorization. In addition, the information and articles described herein are either patented or proprietary, and the copying or reproduction thereof is prohibited without ADVANCED Motion Controls prior written consent. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Thank you for your compliance.