Value changing event in browser? - progress-4gl

define variable hOrderQuery as handle no-undo.
define variable browseOrder-hdl as handle no-undo.
define variable browse-hdl as handle no-undo.
define variable CNumber as integer no-undo.
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(BUFFER Customer:HANDLE).
hQuery:QUERY-PREPARE("FOR EACH Customer").
hQuery:QUERY-OPEN().
CREATE BROWSE browse-hdl
ASSIGN
TITLE = "Customer Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hQuery
X = 2
Y = 2
WIDTH = 74
DOWN = 10
VISIBLE = YES
SENSITIVE = TRUE
READ-ONLY = yes.
browse-hdl:ADD-COLUMNS-FROM(BUFFER Customer:HANDLE,"SalesRep,email,fax,comments,address,City,State,PostalCode").
on value-changed of browse-hdl
do:
FIND CURRENT Customer.
cNumber = Customer.CustNum.
CREATE QUERY hOrderQuery.
hOrderQuery:SET-BUFFERS(BUFFER Order:HANDLE).
hOrderQuery:QUERY-PREPARE("FOR EACH Order where Order.CustNum = " + string(cNumber)) no- error.
hOrderQuery:QUERY-OPEN().
CREATE BROWSE browseOrder-hdl
ASSIGN
TITLE = "Order Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hOrderQuery
X = 2
Y = 240
WIDTH = 74
DOWN = 10
VISIBLE = YES
SENSITIVE = TRUE
READ-ONLY = yes.
browseOrder-hdl:ADD-COLUMNS-FROM(BUFFER Order:HANDLE,"warehousenum,CustNum").
end.
on value-changed of browseOrder-hdl
do:
message "hai" view-as alert-box.
end.
this is my issue.I have 3 browsers.Now i created only two. When I click on first customer browser's one row it should select the current customer and should show his order in the second browser-order browser.
When I click on order browser value it should show the corresponding orderline table values in the 3rd orderline browser(which i didnt create now).
So when I tried to take the browseOrder-hdl to create second value-changed event, it is showing it is already deleted.
How to overcome this issue??Please reply.

DEFINE FRAME MyFrame
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 80 BY 16.
define variable hOrderQuery as handle no-undo.
define variable browseOrder-hdl as handle no-undo.
define variable browse-hdl as handle no-undo.
define variable CNumber as integer no-undo.
DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(BUFFER Customer:HANDLE).
hQuery:QUERY-PREPARE("FOR EACH Customer").
hQuery:QUERY-OPEN().
CREATE BROWSE browse-hdl
ASSIGN
TITLE = "Customer Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hQuery
X = 2
Y = 2
WIDTH = 74
DOWN = 10
VISIBLE = TRUE
SENSITIVE = TRUE
READ-ONLY = TRUE
TRIGGERS:
ON VALUE-CHANGED DO:
RUN ShowOrderBrowser.
END.
END.
browse-hdl:ADD-COLUMNS-FROM(BUFFER Customer:HANDLE,"SalesRep,email,fax,comments,address,City,State,PostalCode").
WAIT-FOR CLOSE OF THIS-PROCEDURE.
/* ********************** Internal Procedures *********************** */
PROCEDURE ShowOrderBrowser:
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
FIND CURRENT Customer.
cNumber = Customer.CustNum.
CREATE QUERY hOrderQuery.
hOrderQuery:SET-BUFFERS(BUFFER Order:HANDLE).
hOrderQuery:QUERY-PREPARE("FOR EACH Order WHERE Order.CustNum = " + STRING(cNumber)).
hOrderQuery:QUERY-OPEN().
CREATE BROWSE browseOrder-hdl
ASSIGN
TITLE = "Order Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hOrderQuery
X = 2
Y = 240
WIDTH = 74
DOWN = 10
VISIBLE = TRUE
SENSITIVE = TRUE
READ-ONLY = TRUE
TRIGGERS:
ON VALUE-CHANGED DO:
MESSAGE "hai"
VIEW-AS ALERT-BOX.
END.
END.
browseOrder-hdl:ADD-COLUMNS-FROM(BUFFER Order:HANDLE,"warehousenum,CustNum").
WAIT-FOR VALUE-CHANGED OF browseOrder-hdl.
END PROCEDURE.

Related

How do I define a variable from another function?

I have a multi-fuction script that is supposed to ask the user for 4 different cars and weigh them based on ratings to give the user the best car to purchase.
What I want to do is have a prompt for every car the user inputs so the user can put in data for each variable the user decides to use. However, when titling the prompt I want to use the cars name in the prompt. It seems impossible to me and Im not sure what to do, im very new to coding.
Main Script
prompt1 = {'How Many Cars (4): '};
title1 = 'Cars';
answer1 = inputdlg(prompt1, title1, [1 40]);
Q1 = str2double(answer1{1});
[N] = Group_Function1(Q1);
Car1 = N(1); %Stores the names of the cars
Car2 = N(2);
Car3 = N(3);
Car4 = N(4);
prompt2 = {'How Many Variables (4): '};
title2 = 'Variables';
answer2 = inputdlg(prompt2, title2, [1 50]);
fprintf('This code can accept costs between 0-100000\n');
fprintf('This code can accept top speeds between 0-200\n');
fprintf('This code can also accept the terms none, some, & alot\n');
fprintf('This code can accept safety ratings between 0-5\n');
Q2 = str2double(answer2{1});
[V,W] = Group_Function2(Q2);
W1 = W(1); %Stores the weights of the varibles
W2 = W(2);
W3 = W(3);
W4 = W(4);
for h=1:Q1
[H] = Group_Function3(V);
Weights(h,:)=H;
end
Group_Function1
function [N] = Group_Function1(Q1)
for Q = 1:Q1
prompt = {'Name of Car:'};
title = 'Car Name';
answer = inputdlg(prompt,title, [1 80])';
N(Q) = answer(1);
end
Group_Function2
function [V,W] = Group_Function2(Q2)
for Q=1:Q2
prompt = {'Variable? (Negative Variables First):','weights in decimal
form?'};
title = 'Variables and Weights';
answer = inputdlg(prompt,title, [1 80])';
V(Q)=answer(1);
W(Q)=str2double(answer{2});
s=sum(W);
end
if s~=1
fprintf('Weights do not add up to 1. Try Again!\n');
Group_Function2(Q2);
end
end
Group_Function3 (Where the problem occurs)
function [H] = Group_Function3(V)
prompt = {V};
title = ['Variable Ratings For' Group_Function1(answer{1})];
h = inputdlg(prompt, title, [1 80])';
end
The Problem
For 'Group_Function3' I want the prompt to include the users inputs from 'Group_Function1' so that when the prompt comes up to input the answers I know which vehicle I am entering for.
Each function runs in its own workspace, it means it does not know the state or content of variables outside of it. If you want a function to know something specific (like the name of a car), you have to give that to the function in the input parameters. A function can have several inputs parameters, you are not limited to only one.
Before going into the Group_Function3 , I'd like to propose a new way for Group_Function1.
Group_Function1 :
You run a loop to ask independantly for each car name. It is rather tedious to have to validate each dialog boxe. Here is a way to ask for the 4 car names in one go:
replace the beginning of your script with:
title1 = 'Cars';
prompt1 = {'How Many Cars (4): '};
answer1 = inputdlg(prompt1, title1 );
nCars = str2double( answer1{1} );
CarNames = getCarNames(nCars) ; % <= use this function
% [N] = Group_Function1(Q1); % instead of this one
and replace Group_Function1 with:
function CarNames = getCarNames(nCars)
title = 'Car Names';
prompt = cellstr( [repmat('Name of car #',nCars,1) , sprintf('%d',(1:nCars)).'] ) ;
CarNames = inputdlg( prompt, title, [1 80] ) ;
end
Now CarNames is a cell array containing the name of your 4 cars (as your variable N was doing earlier. I recommend sligthly more explicit variable names).
You can run the rest of your code as is (just replace N with CarNames, and Q1 with nCars).
Group_Function3 :
when you get to the Group_Function3, you have to send the current car name to the function (so it can use the name in the title or prompt). So replace your Group_Function3 as following (we add an input variable to the function definition):
function H = Group_Function3( V , thisCarName )
prompt = {V};
title = ['Variable Ratings For' thisCarName];
H = inputdlg(prompt, title, [1 80])';
end
and in your main script, call it that way:
for h = 1:nCars
thisCarName = carNames{h} ;
H = Group_Function3( V , thisCarName ) ;
% ...
% anything else you want to do in this loop
end

Email Signature - VBscript for Word, with tables

I'm trying to set a company signature and then implement it with GPO.
Here's what I'm trying to accomplish:
John Hancock | Paralegal | Company, PC
<Logo (to the left of text)> 60 Test Street | PO Box 1389 | Testing, PA 19820
Phone: 555.555.5555| Fax: 555.555.5555 | Email: testing#testing.com (need this hyperlinked)
EDIT: Additional information from comments.
I'm trying to have different attributes (font size, font type, bold, etc) for the text in each particular line within the second row of the table. For example: Test text (this is bold and Calibri) - Test Text 2 (this is not bold and Arial). When I run the script as it stands, I get the logo on the left, in the first column, and a line of text to the right of the logo, in the second column. What I can't figure out is how to add another line of text, on the right, directly underneath the first line, and have that line of text show with different font attributes and such.
Here's the code I have so far:
Set objSysInfo = CreateObject("ADSystemInfo")
Set WshShell = CreateObject("WScript.Shell")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strName = objUser.FullName
strFirst = objUser.FirstName
strLast = objUser.LastName
strInitials = objUser.Initials
strOffice = objUser.physicalDeliveryOfficeName
strPOBox = objUser.postOfficeBox
strTitle = objUser.Description
strCred = objUser.info
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail
strCompany = objUser.Company
Const NUMBER_OF_ROWS = 1
Const NUMBER_OF_COLUMNS = 2
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
Set objRange = objDoc.Range()
objDoc.Tables.Add objRange, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS
Set objTable = objDoc.Tables(1)
Set objShape = objTable.Cell(1, 1).Range.Hyperlinks.Add(objSelection.InlineShapes.AddPicture("\\eg-fileserver\admin space\signature\logo.jpg"), "http://www.eastburngray.com",,,"")
objTable.Columns(1).Width = 20
objTable.Columns(2).Width = 320
objTable.Cell(1, 2).Range.Font.Bold = True
objTable.Cell(1, 2).Range.Font.Name = "Calibri"
objTable.Cell(1, 2).Range.Font.Size = 10
objTable.Range.ParagraphFormat.SpaceAfter = 0
objTable.Cell(1, 2).Range.Text = strFirst & strInitials & strLast & " | " & strOffice & " | " & strCompany
Set objSelection = objDoc.Range()
objSignatureEntries.Add "Full Signature", objSelection
objSignatureObject.NewMessageSignature = "Full Signature"
objDoc.Saved = True
objWord.Quit
The key to adding text with various formatting in Word is to work with a Range object. You can think of a Range like an invisible Selection, with the major difference that you can have as many Range objects as you need - there can be only one Selection. The trick to changing the formatting is to "collapse" the Range (think of it like pressing the Right- or Left-Arrow keys to a blinking "point", then continuing to type).
Edit Note: Based on bibadia's surmise that this is actually about VBScript and not VBA I've changed the tags in your question and am editing my Answer to fit VBScript. VBScript cannot use Word-specific object declarations and enumerations, so I've removed the "Dim As" and replaced all wdEnum with the Integer equivalent.
Using your code as a starting point, the approach could look something like this:
Dim rngCell
Set rngCell = objTable.Cell(1,2).Range
rngCell.ParagraphFormat.SpaceAfter = 0
rngCell.Text = strFirst & strInitials & strLast & " | " & _
strOffice & " | " & strCompany & vbCr
rngCell.Font.Bold = True
rngCell.Font.Name = "Calibri"
rngCell.Font.Size = 10
rngCell.Collapse 0 'wdCollapseEnd
rngCell.MoveEnd 1, -1 'wdCharacter, -1
rngCell.Text = strPhone & " | " & strFax & " | " & strEmail
rngCell.Font.Bold = False
rngCell.Font.Size = 8
Note 1: The order in which you do things is usually reversed from that when typing as a user: First populate the Range, then apply the formatting.
Note 2: When collapsing at the end of a cell, Word will move the Range position to the beginning of the following cell. Thus, the code moves the point back one character, putting it at the end of the previous (original) cell: rngCell.MoveEnd wdCharacter, -1
Note 3: I added a vbCr at the end of the first rngCell.Text to create the new paragraph within the table cell.

enable/disable checkbox by its resident cell location

I want to disable/enable a checkbox in an excel sheet using vba based on the value/conditon of another checkbox. I cannot use the checkbox name, I want to use it's cell location in reference to the cell location of the checkbox that is enabling/disabling it. something like this:
Sub Software2()
Dim myRange As Range
Set myRange = Range(ActiveSheet.Shapes(Application.Caller).TopLeftCell.Address)
If ActiveSheet.Shapes(Application.Caller).ControlFormat.Value = 1 Then
myRange.Interior.ColorIndex = 35
myRange.Offset(0, 1).Interior.ColorIndex = 35
myRange.Offset(0, 2).Interior.ColorIndex = 35
myRange.Offset(1, 1).Interior.ColorIndex = 44
myRange.Offset(1, 2).Interior.ColorIndex = 44
myRange.Offset(2, 1).Interior.ColorIndex = 44
myRange.Offset(2, 2).Interior.ColorIndex = 44
Else
myRange.Interior.ColorIndex = 44
myRange.Offset(0, 1).Interior.ColorIndex = 44
myRange.Offset(0, 2).Interior.ColorIndex = 44
myRange.Offset(1, 1).Interior.ColorIndex = 0
myRange.Offset(1, 2).Interior.ColorIndex = 0
myRange.Offset(2, 1).Interior.ColorIndex = 0
myRange.Offset(2, 2).Interior.ColorIndex = 0
'ActiveSheet.Shapes(location of other checkbox).ControlFormat.Enabled = 0
'ActiveSheet.Shapes(location of other checkbox).ControlFormat.Enabled = 0
End If
End Sub
Here's a demo of how to find a control by its position relative to a range.
TopLeftCell is a bit finicky since the control might drift a bit to the top and/or left and so not get found. Using relative Top/Left position is a bit more robust.
You could even combine the two - depends on the relative size of the cell and the control.
Option Explicit
Sub Tester()
Dim cb
Set cb = GetControlFromRange(Range("B6"))
If Not cb Is Nothing Then
Debug.Print cb.Name
'toggle enabled
With cb.ControlFormat
.Enabled = Not .Enabled
End With
End If
End Sub
Function GetControlFromRange(rng As Range) As Object
Const POS_DELTA_MAX As Long = 10
Dim c As Object, s As Shape
For Each s In rng.Parent.Shapes
If s.Type = msoFormControl Then
'using TopLeftCell
' If Not Application.Intersect(s.TopLeftCell, rng) Is Nothing Then
' Set c = s
' Exit For
' End If
'using position
If Abs(s.Top - rng.Top) < POS_DELTA_MAX And _
Abs(s.Left - rng.Left) < POS_DELTA_MAX Then
Set c = s
Exit For
End If
End If
Next s
Set GetControlFromRange = c
End Function

Dynamically setting font-size using parameter in crystal report

How to set font-size dynamically for all field in crystal report so that using one parameter user can change font-size of whole report ?
You can do it for all fields / texts. See below:
aa = Report.Sections.Item("D").ReportObjects.Count
For i = 1 To aa
Set crxFieldObject = Report.Sections.Item("D").ReportObjects.Item(i)
bb = crxFieldObject.Name
If Mid(bb, 1, 5) = "Field" Then
cc = Val(Mid(bb, 6))
For j = 1 To NumberOfFields 'your value
If cc = xxxxx Then 'if your condition
crxFieldObject.suppress = False
crxFieldObject.Left = Leftxxxx 'your value
crxFieldObject.Top = Topxxxx 'your value
crxFieldObject.Font.Size = Fontsizexxxx 'your value
TenPointHeight = 221 'you can change this, too
If crxFieldObject.Font.Size = 10 Then
crxFieldObject.Height = TenPointHeight
Else
crxFieldObject.Height = TenPointHeight * crxFieldObject.Font.Size / 10
End If
End If
Next j
End If
Next i

What Pascal dialect is this? And what does it do?

I'm investigating somebody's mudball of mixed shell scripts, perl scripts, C code and a curious file called 'rekening.p'.
/*--------------------------------------------------------------------------------
File: rekening.p
Description: Bepalen 868-nummer dossier
History: nabn - 16/04/2004 - Citrix Implementatie (verwijderen van copy-fsk)
jedf - 17/02/2010 - F2009/030 (Aanpassingen voor DBC)
jedf - 20/12/2010 - F2010/024 (Noor)
Pefl - 22/02/2012 - F2012/002 Sequence aanpassing + controle
--------------------------------------------------------------------------------*/
/* Parameters */
DEFINE INPUT PARAMETER iHerv AS INTEGER NO-UNDO.
DEFINE INPUT PARAMETER cParam AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER cDosNr AS CHARACTER NO-UNDO.
/* Variabelen */
DEFINE VARIABLE iZetelNr AS INTEGER NO-UNDO INIT 0.
DEFINE VARIABLE dDosNr AS DECIMAL NO-UNDO.
DEFINE VARIABLE cBron AS CHARACTER NO-UNDO INIT "":u.
DEFINE VARIABLE cPrefix AS CHARACTER NO-UNDO INIT "":u.
DEFINE VARIABLE cMailParams AS CHARACTER NO-UNDO INIT "":u EXTENT 20.
DEFINE VARIABLE pvRestIn AS INTEGER NO-UNDO.
DEFINE VARIABLE pvSeqNaamTx AS CHARACTER NO-UNDO.
ASSIGN
cParam = REPLACE(cParam, ",":u, ";":u)
cParam = TRIM(cParam)
cBron = CAPS(ENTRY(1, cParam, ";":u))
NO-ERROR.
IF NUM-ENTRIES(cParam, ";":u) >= 2
THEN ASSIGN
cPrefix = CAPS(ENTRY(2, cParam, ";":u))
NO-ERROR.
/* Zet sequence naam voor controle. */
CASE cPrefix:
WHEN "934":u THEN ASSIGN pvSeqNaamTx = 'seq-banknr-noor':U.
WHEN "93489":u THEN ASSIGN pvSeqNaamTx = 'seq-banknr-auxircs':U.
OTHERWISE CASE cBron:
WHEN "DBC":u THEN .
OTHERWISE CASE iHerv:
WHEN 1 THEN ASSIGN pvSeqNaamTx = 'seq-banknr':U.
WHEN 2 THEN ASSIGN pvSeqNaamTx = 'seq-bankfinnr':U.
WHEN 3 THEN ASSIGN pvSeqNaamTx = 'seq-banknr':U.
WHEN 4 THEN ASSIGN pvSeqNaamTx = 'seq-banknr-vd':U.
WHEN 5 THEN ASSIGN pvSeqNaamTx = 'seq-banknr-cr':U.
WHEN 6 THEN ASSIGN pvSeqNaamTx = 'seq-cbk':U.
END CASE.
END CASE.
END CASE.
IF LENGTH(pvSeqNaamTx) > 0
THEN DO:
FIND FIRST fsk._sequence NO-LOCK
WHERE fsk._sequence._Seq-name = pvSeqNaamTx
NO-ERROR.
IF AVAILABLE fsk._sequence
AND fsk._sequence._Seq-Max <> ?
AND fsk._sequence._Cycle-OK = FALSE
THEN DO:
ASSIGN
pvRestIn = DYNAMIC-CURRENT-VALUE(pvSeqNaamTx, 'fsk':U)
. /* ff voor de debug. */
pvRestIn = (fsk._sequence._Seq-Max - DYNAMIC-CURRENT-VALUE(pvSeqNaamTx, 'fsk':U)) / fsk._sequence._Seq-Incr
.
IF pvRestIn < 500
THEN DO:
ASSIGN
cMailParams[1] = pvSeqNaamTx
cMailParams[2] = STRING(pvRestIn)
.
RUN programs/RootMail.p
(INPUT '868':U
,INPUT cMailParams
).
END.
END.
END.
CASE cPrefix:
WHEN "934":u THEN ASSIGN cDosNr = "9348":u + STRING(NEXT-VALUE(seq-banknr-noor , fsk), "999999":u).
WHEN '93489':U THEN ASSIGN cDosNr = '9348':U + STRING(NEXT-VALUE(seq-banknr-auxircs, fsk), '999999':U).
OTHERWISE CASE cBron:
WHEN "DBC":u THEN DO:
ASSIGN iZetelNr = INTEGER(ENTRY(2, cParam, ";":u)) NO-ERROR.
/* Waarschuwing sturen via e-mail dat 868-reeks bijna vol is */
IF CURRENT-VALUE(seq-banknr-dbc-fr, fsk) >= 49500 /* 868330 - 868334 = Franstalige klanten */
OR CURRENT-VALUE(seq-banknr-dbc-nl, fsk) >= 99500 THEN DO: /* 868335 - 868339 = Nederlandstalige klanten */
ASSIGN cMailParams[1] = (IF (iZetelNr = 0) THEN "330":u
ELSE "335":u).
RUN programs/RootMail.p(INPUT "868":u,
INPUT cMailParams).
END.
CASE iZetelNr:
WHEN 0 THEN ASSIGN cDosNr = "86833":u + STRING(NEXT-VALUE(seq-banknr-dbc-fr, fsk), "99999":u).
WHEN 1 THEN ASSIGN cDosNr = "86833":u + STRING(NEXT-VALUE(seq-banknr-dbc-nl, fsk), "99999":u).
END CASE.
END.
OTHERWISE CASE iHerv:
WHEN 1 THEN ASSIGN cDosNr = "8686":u + STRING(NEXT-VALUE(seq-banknr, fsk), "999999":u).
WHEN 2 THEN ASSIGN cDosNr = "8685":u + STRING(NEXT-VALUE(seq-bankfinnr, fsk), "999999":u).
WHEN 3 THEN ASSIGN cDosNr = "8686":u + STRING(NEXT-VALUE(seq-banknr, fsk), "999999":u).
WHEN 4 THEN ASSIGN cDosNr = "8688":u + STRING(NEXT-VALUE(seq-banknr-vd, fsk), "999999":u).
WHEN 5 THEN ASSIGN cDosNr = "8689":u + STRING(NEXT-VALUE(seq-banknr-cr, fsk), "999999":u).
WHEN 6 THEN ASSIGN cDosNr = "8687":u + STRING(NEXT-VALUE(seq-cbk, fsk), "999999":u).
END CASE.
END CASE.
END CASE.
/* Bepalen controlenummer */
ASSIGN dDosNr = DEC(cDosNr).
DO WHILE dDosNr > 2100000000:
ASSIGN dDosNr = dDosNr - 970000000.
END.
IF dDosNr MOD 97 = 0
THEN ASSIGN cDosNr = cDosNr + "97":u.
ELSE ASSIGN cDosNr = cDosNr + STRING(dDosNr MOD 97, "99":u).
Anybody got any idea if this is some sort of Pascal dialect?
And for extra points, what does it do?
Thanks in advance.
This is PROGRESS, currently also known as OpenEdge Advanced Business Language.
See also http://en.wikipedia.org/wiki/OpenEdge_Advanced_Business_Language.
Yes, this is indeed Progress ABL.
The name rekening.p is a Dutch name, also comments are in Dutch. The variable cBron can be explained as cSource (bron=source).
The main reason of this program is to return a new invoice number.
It receives 2 input parameters which contains some info about the business/customer (noor / auxircs). Based on that information the correct sequence is used to return the next (new) available number.