• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4193
  • Last Modified:

Nop in visual basic

Is there any statement equivalent to Nop (no operation command) in visual basic?

thanks
0
rajiv11
Asked:
rajiv11
  • 3
  • 2
  • 2
  • +5
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Just curious...what language is Nop from and why would you use it?

Idle_Mind
0
 
mccainz2Commented:
errr I hesitate to post it but

if true then
 'Do Nothing
end if
0
 
mccainz2Commented:
its in REXX and SQL among others....
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
I guess there are two commands that kinda do "nothing".

The first is DoEvents.  It causes all messages in your applications queue to be processed.

Do While Not someBooleanVariable
     DoEvents
Loop

The second is the Sleep() API.  It causes your application to be completely suspended for the specified amount of time in milliseconds.  During this period your application does not respond to any messages at all;as if it had crashed and hung.

Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Public Sub Form_Load()
    Sleep(5000) ' Do absolutely nothing for 5 seconds...
End Sub

Is this what you are looking for?

Idle_Mind
0
 
MsLimCommented:
Not sure what is the meaning of your NOP ?
does it means can not make changes on such field or command , if yes , just diable such field or command
does it means no permmission to use such thing , then just disable it .
does it means if click the command button to process something , then  mccainz2 will be use .
 
0
 
prefixCommented:
I think you are talking about the ASM instruction "NOP".
But I dont think there was a function in vb that only call a NOP instruction.
0
 
GrahamSkanRetiredCommented:
Nope

There is no need for it.

I used to use it on mainframes (Honeywell 200/2000) when memory and speed were a problem, and programming tricks were needed. Instead of setting a variable and testing it to see if an instruction should be done, I would disable the instruction by turning in into a NOP.

Overwriting your machine level code is not considered to be a Good Thing, and is made as difficult as possible by today's operating systems.
 
0
 
EDDYKTCommented:
Don't understand your question

If True Then
::::::::::::::::::
End If

8->
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
There is no equivalent.
0
 
enariCommented:
There is no statement equivelent, however you can write a function to act as NOP or NO-OP.

You can send any variable or no variable into the function, and it will always return true, but you don't need to return the use as anything.  It will tell you that the client is working or that that section of the program is connected.

Public Function NOOP(optional anydata as varient) as boolean
  NOOP = true
End if
0
 
enariCommented:

BTW:

        NOOP (NOOP)

            This command does not affect any parameters or previously
            entered commands.  It specifies no action other than that
            the receiver send an OK reply.
0
 
ashooooCommented:
Instead of ...

if true then
 'Do Nothing
end if

Why dont you use

if false then
 'Do something
end if

0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now