English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how to wirthe the program below in Visual basic.?

in visual basic, let's say
when cellx = 0, then celly is also 0 (copied from cell x)
when cellx turn to 3(>0) , celly also turn to 3 (also copied from cellx)
but when cellx turn back to 0 or less than 0
let's say cellx = 0 (turning back again from 3)
celly remain 3 (not copied from cellx, just remained as it is)
so, when cellx = 0 , celly = 3 (celly must remain >0)

eg. cellx = 0, then celly = 0 (first step)
cellx = 3, then celly = 3 (second step) (cellx turn to >0, and celly follow suit)
cellx = 0, then celly = 3 (third step) (although cellx turn back to 0, celly must remain at 3 (>0) )
hope it is clear what i want to know. please find me the answer.

2006-07-27 04:00:28 · 5 answers · asked by Anonymous in Computers & Internet Programming & Design

5 answers

'How this works:
'dont_return holds the dont return status
'if the dont_return is false then we can change the cellx
'if the dont_return is true then we can not change the cellx
'This will work once in the program. If you wish to reset the
'functionality you will have to reset the dont_return value back to
'False


'Make a command1 button and place under the code
Sub command1_click
'under your first Form1.Load or similar or where you initalize
'your variables place this (or from the original calling point)

dont_return = False ' Our value can change at this moment

'here you place a value for cellx just for test
cellx=2
f=setcelly(cellx)
End Sub

'Under a module or your calling form place and call this

Function setcelly(cellx)
if cellx=0 and dont_return=False then celly=0
if cellx>0 then celly=cellx:dont_return=True
End function

'Under a Module place this
Global dont_return

I hope this helps
Stefanos

2006-07-28 22:45:32 · answer #1 · answered by smendonis 1 · 1 0

If Cellx <= 0 then GoTo Line1
Celly = Cellx
Line1:


Hope this helps

2006-07-27 11:21:58 · answer #2 · answered by Dilip Rao 3 · 0 0

Learn it yourself here is the link

http://cuinl.tripod.com/tutorials.htm

and furthermore do not use goto fuction like person say above. Use label. Implement like this

If Cellx <= 0 then mylabel
Celly = Cellx

mylabel:
your instructions
end sub

2006-07-28 05:26:35 · answer #3 · answered by Joe_Young 6 · 0 0

You might want to try vbforums.com. I am sure there are people there that can help you with what you need. Just explain it a little more clearly.

Good luck!

2006-07-27 11:15:32 · answer #4 · answered by Special Ed 5 · 0 0

don't know sorry

2006-07-27 11:09:15 · answer #5 · answered by green_maths_scout 2 · 0 0

fedest.com, questions and answers