Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Simple Basic (VB) question...  (Read 1260 times)

0 Members and 1 Guest are viewing this topic.

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Simple Basic (VB) question...
« on: August 29, 2006, 08:06:48 am »
Just a quicky....for some reason I can't for the life of me remember the string function to display x amount of a certain character...it works like this, this would return 'c' 10 times:

Keyword("c", 10)

Someone please put me out of my misery, I know it is simple  :banghead:

ChicagoDave

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 196
  • Last login:May 18, 2023, 11:08:23 am
    • Dave's Website
Re: Simple Basic (VB) question...
« Reply #1 on: August 29, 2006, 08:28:01 am »
Just a quicky....for some reason I can't for the life of me remember the string function to display x amount of a certain character...it works like this, this would return 'c' 10 times:

Keyword("c", 10)

Someone please put me out of my misery, I know it is simple  :banghead:

I think you want:

String() - Creates a repeated character string
Language: VBScript

Description
The String() function creates a string of optional length filled with the specified character.

String(length, character)

Example
MyString = String(3, "T") 'returns "TTT"
MyString = String(5, "?") 'returns "?????"

Homer Simpson:
"Here's to alcohol, the cause of, and solution to, all life's problems."

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Simple Basic (VB) question...
« Reply #2 on: August 29, 2006, 09:06:49 am »
That's exactly it, thanks very much...was driving me mad!  :applaud:

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Yesterday at 06:08:43 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Simple Basic (VB) question...
« Reply #3 on: August 30, 2006, 02:32:57 am »
I've gotta ask... what in the world are you going to use it for?

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Simple Basic (VB) question...
« Reply #4 on: August 30, 2006, 04:36:07 am »
I've gotta ask... what in the world are you going to use it for?

Well as it happens I am not now...but I was going to use it in this context:

.TextWidth(String(x, "W")

...just to return the max width of a bunch of characters (guessing W is one of the widest).

But since all characters are a different width (depending on font), I decided it would be better to use a proper string.  But still, it was just bugging me what the darn keyword was! :)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Yesterday at 06:08:43 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Simple Basic (VB) question...
« Reply #5 on: August 30, 2006, 10:04:34 pm »
Well that's what I was wondering.  it isn't particularly useful unless you are wanting to make a dividing line or something. Thought you might be doing something cool.  ;)