I am trying to figure out how to implement a radio button that would allow a person to choose a product to report on, in combination with the dialog box that comes up in this xbasic script.
I got help with this before and this script here basically allows a user to choose beginning and ending months and years to report on, and then in the last it allows the user to choose a well name from the dialog box, and then the report is previewed.
So, I need to figure out how to incorporate the radio button which I thought would be the easiest way to have the user choose what product to report on. the choices are Oil, Gas, or All Products, and I have put a radio button box on the form, and have copied a script out of the xbasic manual and changed the choices. I have attached the script to the "On Arrive" event and it tabs to the radio button box after the beginning and ending months are chosen but before the user chooses the well name.
The thing is as it stands right now, a dialog box comes up instead of seeing the dot beside the choice I make. So, I am sure it is just that I cannot understand how to use this feature from reading just the xbasic manual.
My script so far aside from the radio button actions are shown below:
''XBasic
dim welllisting(1024) as c
dim inputf as p
dim name as c
dim global wellname as c
dim global namex as c
dim i as n
dim prevname as c
dim currname as c
prevname=""
'Set initial values to null (empty) strings
currname=""
inputf=table.open("mmsprp",file_ro_shared)
inputf.index_primary_put("Property")
i=1
inputf.fetch_first()
prevname=alltrim(inputf.new_prprty)
'Set prevname var to first wellname in list
while .not. inputf.fetch_eof()
if prevnamecurrname then
'currname is not same as prevname, so
welllisting(i)=inputf.new_prprty
' add it to the array. Otherwise don't.
prevname=currname
'Assign value of currname to prevname, since
end if
'it has now been added to the array. If next
inputf.fetch_next()
'record has same value, it will be skipped.
currname=alltrim(inputf.new_prprty)
'put trimmed value of new_prprty in var
i=i+1
end while
name=ui_get_list_array("Select your well",1,"welllisting")
namex=substr(name,1,25)
inputf.close()
if name"" then
'user did not cancel, so
report.preview("Report by Well Name")
'ok to preview report. Otherwise don't
end if
end
I got help with this before and this script here basically allows a user to choose beginning and ending months and years to report on, and then in the last it allows the user to choose a well name from the dialog box, and then the report is previewed.
So, I need to figure out how to incorporate the radio button which I thought would be the easiest way to have the user choose what product to report on. the choices are Oil, Gas, or All Products, and I have put a radio button box on the form, and have copied a script out of the xbasic manual and changed the choices. I have attached the script to the "On Arrive" event and it tabs to the radio button box after the beginning and ending months are chosen but before the user chooses the well name.
The thing is as it stands right now, a dialog box comes up instead of seeing the dot beside the choice I make. So, I am sure it is just that I cannot understand how to use this feature from reading just the xbasic manual.
My script so far aside from the radio button actions are shown below:
''XBasic
dim welllisting(1024) as c
dim inputf as p
dim name as c
dim global wellname as c
dim global namex as c
dim i as n
dim prevname as c
dim currname as c
prevname=""
'Set initial values to null (empty) strings
currname=""
inputf=table.open("mmsprp",file_ro_shared)
inputf.index_primary_put("Property")
i=1
inputf.fetch_first()
prevname=alltrim(inputf.new_prprty)
'Set prevname var to first wellname in list
while .not. inputf.fetch_eof()
if prevnamecurrname then
'currname is not same as prevname, so
welllisting(i)=inputf.new_prprty
' add it to the array. Otherwise don't.
prevname=currname
'Assign value of currname to prevname, since
end if
'it has now been added to the array. If next
inputf.fetch_next()
'record has same value, it will be skipped.
currname=alltrim(inputf.new_prprty)
'put trimmed value of new_prprty in var
i=i+1
end while
name=ui_get_list_array("Select your well",1,"welllisting")
namex=substr(name,1,25)
inputf.close()
if name"" then
'user did not cancel, so
report.preview("Report by Well Name")
'ok to preview report. Otherwise don't
end if
end
Comment