Reputation:
Hello i have this code in vb6 and i want the code to break operation if i click the cancel button but i cant seem to do it i searched online and found nothing, is it possible to do it? This is the code below:
if value <= temp then
if (msgbox("Select an option", vbOKCANCEL + vbExclamation, MSG_TITLE) = vbCancel) Then
'i want the code to break here and stop as it is to do nothing
else
'extra code
end if
end if
Any idea how can i do that i think vb6 doesnt have BREAK
as a function
Upvotes: 2
Views: 424
Reputation: 1
if value <= temp then
if (msgbox("Select an option", vbOKCANCEL + vbExclamation, MSG_TITLE) = vbCancel) Then
goto keluar
else
'extra code
end if
end if
keluar:
Upvotes: -1
Reputation: 78210
if value <= temp then
if msgbox("Select an option", vbOkCancel Or vbExclamation, MSG_TITLE) = vbCancel Then
' Do nothing
else
' extra code
end if
end if
if value <= temp then
if msgbox("Select an option", vbOkCancel Or vbExclamation, MSG_TITLE) <> vbCancel Then
' extra code
end if
end if
if value <= temp then
if msgbox("Select an option", vbOkCancel Or vbExclamation, MSG_TITLE) = vbCancel Then
Exit Sub
else
' extra code
end if
end if
Upvotes: 3