ScreenIO - Combo Boxes

Discussion about software products provided for the BR community and created by its members. This includes (but is not limited to): MyEdit, File IO, Screen IO, FNSnap, and Utilities written in other languages for use with Business Rules.

Moderators: Susan Smith, admin, Gabriel

Susan Smith
Posts: 654
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

ScreenIO - Combo Boxes

Postby Susan Smith » Sat Oct 29, 2011 1:38 pm

This is a re-posting of an Email conversation about ScreenIO's new combo box feature and how to implement it using the populate event. I thought that others who are using ScreenIO (or plan to in the future) could benefit from this as well. I have Gabriel's permission to repost it. Thanks to Doug for bringing up the question.

-- Susan

Doug's question is below, but here is the answer:

This:

def fnPopulateTaxClass(mat ReturnData$)
mat ReturnData$(10)
Restore TaxClasses
Read mat ReturnData$
let fnPopulateTaxClass=1
fnend

TaxClasses: !
Data "01 Individual/Sole Proprietor","02 C Corporation","03 S Corporation","04 Partnership","05 Trust/Estate","06 LLC - C Corporation","07 LLC - S Corporation","08 LLC - P Partnership","09 Other","10 Exempt Payee"


Populate functions act as both a populate and a validate function. As a populate function, you want to modify and resize an array called "mat ReturnData$". The name has to be ReturnData$. But you do not have to list it in the function parameter list. It is optional to do so. I did so in the example above, to make the example easier to read and understand.

As a validate function, you want to validate the current selection, do any related work, and return true to accept the users change.

You can tell which is which because Validate functions receive FieldText$ while all other functions do not.

def fnPopulateTaxClass
if len(FieldText$) then
! Validation code
let fnPopulateTaxClass=1
else
! Populate Code
mat ReturnData$(10)
Restore TaxClasses
Read mat ReturnData$
end if
fnend

TaxClasses: !
Data "01 Individual/Sole Proprietor","02 C Corporation","03 S Corporation","04 Partnership","05 Trust/Estate","06 LLC - C Corporation","07 LLC - S Corporation","08 LLC - P Partnership","09 Other","10 Exempt Payee"


-- Gabriel



On Thu, Oct 27, 2011 at 4:08 PM, Doug Meenen <dmeenen@yahoo.com> wrote:

Gabriel,
I got the new version of Screenio installed and running.

What do you put into the Populate function for the combo data? mat txclass$?

I have 10 items I want to use for the Tax Class.

00452 Dim TXCLASS$(10)*30,TX_FRM$(10)*20,DATA$(1)*30
00454 Data "01 Individual/Sole Proprietor","02 C Corporation","03 S Corporation","04 Partnership","05 Trust/Estate","06 LLC - C Corporation","07 LLC - S Corporation","08 LLC - P Partnership","09 Other","10 Exempt Payee"
00456 Read MAT TXCLASS$
00458 For X=1 To UDIM(TXCLASS$) : Let TX_FRM$(X)=STR$(X)&",1,c 30,[D]" : Next X

from the old program.

Doug Meenen

Return to “3rd Party Software from the BR Community”

Who is online

Users browsing this forum: No registered users and 1 guest

cron