News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Visual Basic Q?

Started by vanjast, April 12, 2012, 09:11:45 PM

Previous topic - Next topic

vanjast

Yes yes.. I know  :bg
As mentioned.. I test concepts in VB before I apply to Asm..

I came across a real funny in VB... Stack overflow??
After a few times i thought that there must be something re-entrant happening... and true's Bob it was.

I usually write VB as I write asm, returning True or False.
With VB the boolean is applied to the FUNCTION name....
..but I made the mistake of applying this to a SUB name, and this made it go 're-entrant' and stack overflow

just off the cuff, any clues... I don't want to go to any VB forums as this is only a test thingy, otherwise I'll just move on..
:8)

baltoro

...I've heard it said that Visual Basic is actually a disease,... :eek
...OH !!! YEAH !!!...
:dazzled: I see what you mean,...by,...Yes, yes, I know,... :dazzled:
Baltoro

dedndave



we cannot "gleen" the answer without seeing some code   :lol

freckled, freckled, drunk....

your code here



...name 3 things that Irish whores have in common

zemtex

Can you optimize this code for me dedndave?



just kiddin dave...
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

dedndave

by god, that looks pretty optimal to me, just the way it is   :bg

QuoteI CAN SEE CLEARLY NOW THE RAIN IS GONE
I CAN SEE ALL OBSTACLES IN MY WAY
Gone are are the dark clouds that had me blind
IT'S GONNA BE A BRIGHT BRIGHT BRIGHT SUN SHINY DAY

zemtex

Poetry is madness.


What could possibly be less natural, if you observe a fish:

1: You write about it
2: You eat it.  :lol
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

dedndave

first, you alter the fish by merely observing it   :bg

that's why everything tastes like chicken

zemtex

As an assembly programmer, we are trained to think logically and we are trained to eliminate trapholes and flaws. But once in a while, you should consider a joke.  :bg
I have been puzzling with lego bricks all my life. I know how to do this. When Peter, at age 6 is competing with me, I find it extremely neccessary to show him that I can puzzle bricks better than him, because he is so damn talented that all that is called rational has gone haywire.

jj2007

Quote from: vanjast on April 12, 2012, 09:11:45 PM
just off the cuff, any clues...

Ask Olly, he usually has an answer :bg

P.S.: When I went to the forum this morning, there were 88 guests and 15 unread posts, virtually all of them related to programming. Until YOU came along with this dirty talk about Irish whores and rotten fish and poetry and the like :naughty:

hutch--

 :bg

What's wrong with Irish whores ? Such a nice girl to be sure to be sure.  :P
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

baltoro

Quote from: DAVE !!!...that's why everything tastes like chicken,...
:dazzled: ...So Zen,...and,...optimized for other galaxies, too,... :dazzled:
Baltoro

dedndave

 :P

i dunno what dark matter is, but i am sure it comes with a chicken flavour packet   :lol

baltoro

DAVE !!!
...I don't know why I ever doubted you,...
:dazzled: ...Disambiguation and existential doubt,...regression,...neurosis,...and, of course, unspecified damages,... :dazzled:
Baltoro

vanjast

OK code thingy

ASM
Quote
myProc Proc..

   blah blah
   blah blah
   .
   .
   Return TRUE   ;if OK ( FALSE if NOK)


myProc   Endp

VB Function
Quote
Public  Function myFunc () as boolean
On Error goto ThisError           'simple error handler
  myFunc = TRUE                   'The OK signature

  Exit Function                       'Outa here!

ThisError:
   myFunc = FALSE                  'NOK indicator
End Function

I made a mistake by doing the same with a Subroutine (SUB)
VB Subroutine
Quote
Public SUB mySub ()
On Error goto ThisError           'simple error handler
  mySub = TRUE                    'The OK signature - THIS PRODUCES A RE-ENTRANT PROCEDURE
                                           'IT PROBABLY STUFFS UP THE RETURN STACK POINTER

  Exit SUB                              'Outa here!

ThisError:
   mySub = FALSE                  'NOK indicator - THIS WILL GET IT OUT OF THE RE-ENTRANT CYCLE
End Sub

Maybe this might effect the Power Basic code

..Ten green bottles standing on the wall..  :wink

dedndave

maybe it's the ExitSub - not really sure how the VB compiler handles that
try this...
Public SUB mySub ()
On Error goto ThisError           'simple error handler
  mySub = TRUE                    'The OK signature - THIS PRODUCES A RE-ENTRANT PROCEDURE
                                           'IT PROBABLY STUFFS UP THE RETURN STACK POINTER

  Exit SUB                              'Outa here!

ThisError:
   mySub = FALSE                  'NOK indicator - THIS WILL GET IT OUT OF THE RE-ENTRANT CYCLE

  Exit SUB                              'Outa here!

End Sub

if that doesn't fly
you have GOTO ?   :P