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:

Recommended Answers

All 2 Replies

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;

Hmm i found the answer ...

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

Nathan.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.