Search found 8 matches

by Amod Gokhale
8 Mar 2017 8:36
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

Hi Harrison,

Thanks for your detail reply, it worked and prevents numbers.

For now went with solution provided by Gukalov as it fits with current system requirement.
by Amod Gokhale
8 Mar 2017 8:34
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

Re:

Simplier to delete spaces before checking: if string:hasAlpha(string::replaceAll(Control:getText(), " ", "")) then But to check if entering name is correct you need something more sirious than just letters&spaces))) "A m o d Go kh ale" ?!))) Perfect!!!!!. I used this solution. Don't know how to mar...
by Amod Gokhale
7 Mar 2017 17:34
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

Hi Gukalov,

Thank you so much!!!!!

Now it rejects numbers.. just another question. Now it doesn't allow spaces. Do I need to write another condition for that

e.g. Amod Gokhale is rejected but AmodGokhale works
by Amod Gokhale
7 Mar 2017 17:24
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

i tried that on this line
if _ = string::hasAlpha(Control:getText()) then

it says error c502 : The expression does not produce a value

if _ = string:hasAlpha(Control:getText()) then

error i get is error c229: Undeclared identifier 'string'
by Amod Gokhale
7 Mar 2017 16:46
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

Hi Gukalov,

How to use this in class predicates
validateNumber : control::validateResponder.
clauses
validateNumber(Control) = control::contentsOk :-

Can you please post complete code?
by Amod Gokhale
7 Mar 2017 14:20
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

Hi Harrison, Yes i did. it gives error on fail error c631 : The predicate 'demoForm::onNameChar/3-> (i,i,i)', which is declared as 'procedure', is actually 'determ' predicates onNameChar : window::charResponder. clauses onNameChar(_Source, Char, _ShiftControlAlt) = window::defaultCharHandling:- %-- ...
by Amod Gokhale
7 Mar 2017 5:57
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

Hi Harrison,

Thanks for your reply. I tried running below program but got this error on fail

error c631 : The predicate 'demoForm::onNameChar/3-> (i,i,i)', which is declared as 'procedure', is actually 'determ'
by Amod Gokhale
6 Mar 2017 16:43
Forum: Visual Prolog
Topic: Visual Prolog : Edit Control : Check if string contains numbers
Replies: 16
Views: 5146

Visual Prolog : Edit Control : Check if string contains numbers

We are using below example to validate that edit control only contains numbers. class predicates validateNumber : control::validateResponder. clauses validateNumber(Control) = control::contentsOk :- hasDomain(integer, _X), _X = trytoTerm(Control:getText()), !. validateNumber(Control) = control::cont...