PDA

View Full Version : XBasic / Query


ABC123

Peter Patriquin
04-03-2000, 08:05 AM
New to xbasic and can not figure out solution to the following -
Want to run table query from a main menu with user input (ie ui-get-text) need to modify variable after user input to reflect *any* characters in field and then display results in a browse. Here is the xbasic action on the button of the main menu, I get an error with the query filter.

Thanks for the help,

Peter

Form.View("models only@c:alpha 5 datacentral iimodels.dbf")
:models_only.activate()
appl=ui_get_text("model number","enter model number")
anyappl="*"+appl+"*"
tbl = table.current()
query.description = "model query"
query.order = "MODEL_NUMBER"
query.filter = "SMATCH((MODELS->MODEL_NUMBER),(str(anyappl)))"
query.options = "I"
:model_browse.activate()

Selwyn Rabins
04-03-2000, 09:45 AM
try this:

P = Form.load("models only")
Appl = appl=ui_get_text("model number","enter model number")

P:tables:models.filter_expression = " appl $ model_number"
P:tables:models.query()
P:show()
P:activate()

Selwyn Rabins
04-03-2000, 09:46 AM
OOPS. made a typo

P = Form.load("models only")
Appl = ui_get_text("model number","enter model number")

P:tables:models.filter_expression = " appl $ model_number"
P:tables:models.query()
P:show()
P:activate()