a smal problem

Discuss all aspects of programming here.

Moderator: The Mod Squad

a smal problem

Postby intel11 » Thu Mar 24, 2005 3:04 am

Am writting a prog in Basic, it ginves the following results on the screen, each time the incoming value is 0 like this:

Value = 0
Value = 0
Value = 0
Value = 0
Value = 0
Value = 0
Value = 0
Value = 0
.
.
.
.
.
and so on

and in case the Value changed to whatever so it shows like this:

Value = 34
Value = 65
Value = 76
Value = 12
Value = 98
Value = 456
Value = 9876
Value = 34543508790
Value = 4
.
.
.
.
.
.and so on

What I want this prog to do is to show me the value = 0 on the same line in the same place, I cant put a timer like becase I dont know whe 0 would come. and in case the value changed so continue the previous like this:

Value = 0 (should wait until a change happen)

Value = 3 (now the value changed so it working)
Value = 546
Value = 9561
Value = 321
Value = 357
Value = 56
Value = 951475
Value = 8


hope its clear, plz help (with CODE)as soon as poss
intel11
Initiate
Initiate
 
Posts: 76
Joined: Wed Jun 11, 2003 4:31 am

Postby pa3lsvt » Thu Mar 24, 2005 7:02 pm

No, it's not really clear, but this might be what you mean:

pseudo-code:
Code: Select all
get the value
print("Value = " & value)
LOOP
get the value
IF value != 0 THEN print("Value = " & value)
END LOOP
pa3lsvt
 

Postby intel11 » Mon Mar 28, 2005 4:26 am

pa3lsvt , THANK U...

sorry for the delay in replying.

its working now by using a variable as follows:

5 FLAG = 0
5000 IF FLAG = 0 then GOTO 5050 ELSE GOTO 5300
5050 PRINT "VALUE = 0 ", CR
5060 FLAG =1
5100 XBY(ADR1)=080H
5200 UO 1 : PRINT " VALUE = 0 ": UO 0
5300 GOTO 1000
intel11
Initiate
Initiate
 
Posts: 76
Joined: Wed Jun 11, 2003 4:31 am


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron