Post Reply 
Problems with INPUT, need some help
07-12-2022, 11:55 AM
Post: #1
Problems with INPUT, need some help
I have a simple INPUT, of date items and one real item.
The last is the variable GMT.
How should I change the INPUT so the GMT change will be work.

Cheers,
Jan

Code:
EXPORT Test_Input()
BEGIN
  LOCAL jaar :=floor(Date),
  LOCAL maand:=floor((Date-floor(Date))*100);
  LOCAL dag  :=floor((Date*100-floor(Date*100))*100);
  LOCAL GMT  := -2; // Amsterdam at summertime
  INPUT({jaar,maand,dag,GMT},"Date",{"Year?","Month?","Day?","GMT?"},{"Year","Month","Day","GMT"}, {Date,Date,Date,Date});

  PRINT();
  PRINT("jaar:"+jaar);
  PRINT("maand:"+maand);
  PRINT("dag:"+dag);
  PRINT("GMT:"+GMT);
END;
Find all posts by this user
Quote this message in a reply
07-13-2022, 01:28 PM
Post: #2
RE: Problems with INPUT, need some help
This works, the non-simple versions of Input isn't so simple.

Code:
EXPORT Test_Input()
BEGIN
  LOCAL jaar :=floor(Date);
  LOCAL maand:=floor((Date-floor(Date))*100);
  LOCAL dag  :=floor((Date*100-floor(Date*100))*100);
  LOCAL GMT  := -2; // Amsterdam at summertime
  INPUT({jaar,maand,dag,GMT},{"Year?","Month?","Day?","GMT?"});

  PRINT();
  PRINT("jaar:"+jaar);
  PRINT("maand:"+maand);
  PRINT("dag:"+dag);
  PRINT("GMT:"+GMT);
END;
Find all posts by this user
Quote this message in a reply
07-13-2022, 01:57 PM
Post: #3
RE: Problems with INPUT, need some help
(07-13-2022 01:28 PM)matalog Wrote:  This works, the non-simple versions of Input isn't so simple.

Code:
EXPORT Test_Input()
BEGIN
  LOCAL jaar :=floor(Date);
  LOCAL maand:=floor((Date-floor(Date))*100);
  LOCAL dag  :=floor((Date*100-floor(Date*100))*100);
  LOCAL GMT  := -2; // Amsterdam at summertime
  INPUT({jaar,maand,dag,GMT},{"Year?","Month?","Day?","GMT?"});

  PRINT();
  PRINT("jaar:"+jaar);
  PRINT("maand:"+maand);
  PRINT("dag:"+dag);
  PRINT("GMT:"+GMT);
END;

Thanks, this is realy simple.
Find all posts by this user
Quote this message in a reply
07-13-2022, 05:57 PM
Post: #4
RE: Problems with INPUT, need some help
Bonjour

J'ai déjà pensé à écrire un programme qui faciliterait la programmation des INPUTS
un peu compliqués, une sorte d'assistant qui renverrai à la fin la ligne de commande
sous forme de chaîne de caractères ou de note que l'on pourrai copier/collé dans nos
programmes.
Sans doute faudrait-il beaucoup de INPUT pour réaliser celà :-)

Hello

I've already thought of writing a program that would facilitate the programming of INPUTS
a bit complicated, a kind of assistant that would return at the end the command line
in the form of a string or a note that we could copy/paste into our
programs.
It would probably take a lot of INPUTS to do this :-)

Sorry for my english
Find all posts by this user
Quote this message in a reply
07-14-2022, 10:24 AM
Post: #5
RE: Problems with INPUT, need some help
(07-13-2022 01:28 PM)matalog Wrote:  This works, the non-simple versions of Input isn't so simple.

Code:
EXPORT Test_Input()
BEGIN
  LOCAL jaar :=floor(Date);
  LOCAL maand:=floor((Date-floor(Date))*100);
  LOCAL dag  :=floor((Date*100-floor(Date*100))*100);
  LOCAL GMT  := -2; // Amsterdam at summertime
  INPUT({jaar,maand,dag,GMT},{"Year?","Month?","Day?","GMT?"});

  PRINT();
  PRINT("jaar:"+jaar);
  PRINT("maand:"+maand);
  PRINT("dag:"+dag);
  PRINT("GMT:"+GMT);
END;

When I put in an negative number got an error "error: invalid input", when I put a positive number it is accepted!
When setting the calculator setting to schoolbook or algebraic then the negative number is accepted.
Find all posts by this user
Quote this message in a reply
07-14-2022, 11:52 AM
Post: #6
RE: Problems with INPUT, need some help
Try this:

INPUT({{jaar,[0]},{maand,[0]},{dag,[0]},{GMT,[0]}},{"Year?","Month?","Day?","GMT?"});

for the input line so it only accepts floats. It worked for me in textbook, algebraic, and rpn modes.

-road
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)