I've been teaching myself Xbasic over the past couple years, mostly going by code examples and the various Windows help files. One area where I have squeaked by thus far is table references, but my current project requires a more complete understanding of the syntax than I currently hold.
I will start with some background in case I am approaching this from the wrong angle. We currently have a form used for order entry. The underlying table has many field rules that perform Lookups and run custom scripts OnSave, etc. This part of the system works great.
We are now trying to expand this system to enter orders pulled from our website using ODBC. Data entry has become a problem. By all indications, the script will not trigger any of the field rules, whether they be lookups or the various field event scripts. The former is not a problem, these are trivial lookups which I would not mind duplicating in Xbasic. The problem I'm having is with the events: these will perform more complex validations and calculations, sending e-mails and converting numbers and other programming tasks. All this code is sidestepped in the traditional enter_begin() method.
I am attempting to find some compromise that will execute code whether a user is entering data, or the code is entering data.
Obviously, I would like to reduce code duplication as much as possible. My current problem is with the (perceived?) syntax differences in table references as you switch between field event code and standalone scripts. The former will reference tables using the arrow syntax (orders->order_num) and the latter will use the dot syntax (order.order_num).
What would help at this point would be some clear examples of when the different syntaxes are appropriate, and perhaps if there is a common syntax that could apply to both cases. I would not be opposed to two setup scripts that called a common child script to perform the actual logic. I'm just not sure what's most appropriate. Any suggestions on possible flow and syntax, or even a link to some reference would be greatly appreciated.
Thanks in advance.
I will start with some background in case I am approaching this from the wrong angle. We currently have a form used for order entry. The underlying table has many field rules that perform Lookups and run custom scripts OnSave, etc. This part of the system works great.
We are now trying to expand this system to enter orders pulled from our website using ODBC. Data entry has become a problem. By all indications, the script will not trigger any of the field rules, whether they be lookups or the various field event scripts. The former is not a problem, these are trivial lookups which I would not mind duplicating in Xbasic. The problem I'm having is with the events: these will perform more complex validations and calculations, sending e-mails and converting numbers and other programming tasks. All this code is sidestepped in the traditional enter_begin() method.
I am attempting to find some compromise that will execute code whether a user is entering data, or the code is entering data.
Obviously, I would like to reduce code duplication as much as possible. My current problem is with the (perceived?) syntax differences in table references as you switch between field event code and standalone scripts. The former will reference tables using the arrow syntax (orders->order_num) and the latter will use the dot syntax (order.order_num).
What would help at this point would be some clear examples of when the different syntaxes are appropriate, and perhaps if there is a common syntax that could apply to both cases. I would not be opposed to two setup scripts that called a common child script to perform the actual logic. I'm just not sure what's most appropriate. Any suggestions on possible flow and syntax, or even a link to some reference would be greatly appreciated.
Thanks in advance.
Comment