• 0

[VB] I need a "not like" statement


Question

haha, Ive been milkin you guys with all my VB problems today ;)

Alright so I have a check to make sure that the number entered is actully a #, it goes:

If min.Text Like "#" Then betch.Value = 1

thing is farther dow I want to have another check where if it detects anything but a number I want it to set betch.value to 0. So bascilly what Im looking for is a "not like" command or any workaround. Thanks, you guys have been of great help to me on this project of mine.

Link to comment
https://www.neowin.net/forum/topic/470938-vb-i-need-a-not-like-statement/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

oh man, thank you. this forum has made me feel stupid multiple times now. argg!! :) seriously though thanks for that.

EDIT: hmm it works but not very well, if I cant figure out whats wrong in the next few minutes Ill post it up here.

EDIT: I figued it out, I needed the "Else betch.Value = 0" on both levels of my nested if.

EDIT: alright probelm # 2. I have this line of code:

 If hour.Text Like "#" Then
--long list of stuff down here but adventuly turns off something

problem is, as you may know, an hour can be 1 digit, or 2 digits. What Im looking for this time is like an

if hour.text like "#" or "##" then

kind of command, any ideas on this one?

If I dont get a response Ill make anew thread.

Edited by hobblyhoy
  • 0

Just put the isnumeric() in an if statement

I dont know if this is the exact syntax for VB because I havnt touched it in almost a year.

if isnumeric(textbox1.text) then

textbox2.text = "ITS A NUMBER!!!"

else

textbox2.text = "ITS NOT NUMBER!!! WHY NOT???"

end if

  • 0
  Quote
EDIT: alright probelm # 2. I have this line of code:

If hour.Text Like "#" Then

--long list of stuff down here but adventuly turns off something

problem is, as you may know, an hour can be 1 digit, or 2 digits. What Im looking for this time is like an

if hour.text like "#" or "##" then

kind of command, any ideas on this one?

If I dont get a response Ill make anew thread.

again ur right alredy :p

if hour.text like "#" or hour.text like "##" then

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Steam finally has a native app for Apple Silicon Macs by Taras Buria About half a decade ago, Apple released the first Apple Silicon-based Macs with ARM processors, kicking off its chip revolution and severing ties with Intel. These chips were received to critical acclaim, and many developers optimized their apps for ARM relatively quickly—not Valve, though. Valve is only now getting ready to ship a native Steam client for macOS. The latest Steam Beta update is finally optimized for Apple Silicon, which means the app no longer relies on Rosetta 2, Apple's translation layer that emulates x86 applications on ARM-based chips. It is hardly surprising that it took Valve so long to optimize its client for Apple Silicon, considering Apple's low market share on Steam. Valve's monthly Hardware and Software Survey (check out the latest data here) shows that macOS has only 1.85% of all users, which is hardly what you call a priority. The survey's page itself makes it clear that the results help developers decide where to invest their time and effort. In recent years, Apple Silicon has made big strides in terms of graphical performance, which has made Mac a better gaming platform than before. Apple is also not giving up on its ongoing effort to make gaming on Mac more attractive. Every macOS release introduces new tools for developers and gamers (the recently announced iOS/iPadOS/macOS 26 received a new "Gaming" hub). Unfortunately for Apple, Macs still aren't popular for gaming, and the fact that it took Valve five years to optimize Steam for Apple Silicon just shows how difficult it is to convince everyone that Mac can game, too. In addition to native Apple Silicon support, the latest Steam Client Beta introduced improvements for Steam Chat, In-Game Overlay, and SteamOS. The complete changelog is available on the official Steam Community page.
    • It's been many years since i tried out Linux Mint along with Openoffice. These would be great for someone that just wants to browse the web and send emails and do a spreadsheet, but for anything beyond that its a heartache. Hard enough nowadays to get a 50 series GPU to run on windows properly, never mind under Linux
    • Again, you're confusing Copilot (the app) versus the Copilot+ PC certification. Related, but totally different things. The standalone app does certain basic things, but a PC with the Copilot+ certification can do a lot more AI stuff. They're not the same. Anyone can install the Copilot app, but not everyone can use the Copilot+ PC funcionalities, you need a compliant PC to do that.
    • I think you never tried Fedora... the most polished linux version I ever experienced. Better in my opinion than Ubuntu.
  • Recent Achievements

    • First Post
      NeoToad777 earned a badge
      First Post
    • Week One Done
      JoeV earned a badge
      Week One Done
    • One Month Later
      VAT Services in UAE earned a badge
      One Month Later
    • First Post
      LsDmT earned a badge
      First Post
    • Week One Done
      evershinefacilityservice earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      572
    2. 2
      ATLien_0
      250
    3. 3
      +Edouard
      162
    4. 4
      +FloatingFatMan
      147
    5. 5
      Michael Scrip
      111
  • Tell a friend

    Love Neowin? Tell a friend!