0

I am using HLA to learn assembly. I choosen HLA because of different reason.

Main topic:

I try to do a HLA script using try..exception..endtry statement but i have error... can u tell me where i mixed up

program driver;
#include("stdlib.hhf");
#include("excepts.hhf");
static

goodinteger: int32;
i:int32;
begin driver;
repeat
mov(false,goodinteger);
try
stdout.put("Enter an integer: ");
stdin.get(i);
mov(true,goodinteger);
exception( ex.conversionerror );
stdout.put("illegal numeric value, please re-enter",nl);
exception(ex.valueoutofrange);
stdout.put("Value is out of range, please re-enter",nl);
endtry; 
until(goodinteger);
end driver;

These are the codes anyone know what's wrong with it tell me .. thanks in advance :cool:

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Evenbit
0

Hmm i found the answer can i post answer to my question...

program driver;
#include("stdlib.hhf");
static

goodinteger:boolean;
i:int32;
begin driver;
repeat
mov(false,goodinteger);
try
stdout.put("Enter an integer: ");
stdin.get(i);
mov(true,goodinteger);
exception( ex.ConversionError );
stdout.put("illegal numeric value, please re-enter",nl);
exception(ex.ValueOutOfRange);
stdout.put("Value is out of range, please re-enter",nl);
endtry; 
until(goodinteger);
end driver;
0

Hmm i found the answer ...

Yep, HLA's type-checking can cause a little angst until you get comfortable with it.

Nathan.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.