Text
-
- User
- Posts: 27
- Joined: Sun Jul 13, 2008 9:47 am
- Location: UK
Text
I have a text input, but I only want to have text (not numbers) entered.
Is there a way of telling betwwen the two please.
Is there a way of telling betwwen the two please.
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
OK ugly code... but it should work... not at my compiler for an hour...

Code: Select all
temp$ = INPUT$
ROFL = len(temp$)
OK = 0
for X = 0 to ROFL
lookat = Asc(Mid(temp$,rofl,1))
if lookat > 65
OK = 1
endif
next
if OK = 1
; input good!
else
; BAD INPUT
endif

Any numbers at all or just a number instead of text?
Is "I'm 10 years old" a no no? There may be a shortcut with val()
Rooks code will be heaps faster with pointers
whenever I see Asc(Mid()) alarms go off in my head
I vaguely recall that there is some subclassing method to apply filters or something too but I suck at that so I can't post any code
Is "I'm 10 years old" a no no? There may be a shortcut with val()
Rooks code will be heaps faster with pointers


I vaguely recall that there is some subclassing method to apply filters or something too but I suck at that so I can't post any code

Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
I can relate to that, I certainly wouldn't post pointer code without testing..
you win
you win

Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
-
- User
- Posts: 27
- Joined: Sun Jul 13, 2008 9:47 am
- Location: UK
Thanks
Thanks for your work on this one
As the last poster says, I was using several textgadget to input data, but of only 4 numbers. and one box could only contain text.
While I am here, does anyone know how to use setfiledate
I have a load of files that I wanted to alter the creation dates so my mp3 player will play them in the order I want - its for amateur drama.
does anyone have an example of how to do this.
Thanks
As the last poster says, I was using several textgadget to input data, but of only 4 numbers. and one box could only contain text.
While I am here, does anyone know how to use setfiledate
I have a load of files that I wanted to alter the creation dates so my mp3 player will play them in the order I want - its for amateur drama.
does anyone have an example of how to do this.
Thanks
Re: Thanks
Here's an example that loops through files listed in an array and sets the date by adding sequential day values to an arbitrary start date:dannyboy99 wrote:Thanks for your work on this one
As the last poster says, I was using several textgadget to input data, but of only 4 numbers. and one box could only contain text.
While I am here, does anyone know how to use setfiledate
I have a load of files that I wanted to alter the creation dates so my mp3 player will play them in the order I want - its for amateur drama.
does anyone have an example of how to do this.
Thanks
Code: Select all
startDate.l = ParseDate("%yy/%mm/%dd", "02/12/01") ;pick your start date
numberOfSongs.l = 30
For sequenceNumber = 1 to numberOfSongs
songFile.s = songFilenameArray.s(sequenceNumber) ;a sample entry in the songFilenameArray would look like "C:\Song.mp3"
SetFileDate(songFile, #PB_Date_Created ,AddDate(startDate, #PB_Date_Day, sequenceNumber.l))
Next
-
- User
- Posts: 27
- Joined: Sun Jul 13, 2008 9:47 am
- Location: UK
Problem
I tried this, but I get an error message saying
song.s() is not a function (or not available in demo mode)
And should songs.s be the directory where all the sound effects are stored.
Knowing me, I have done something wrong, but I an not sure what.
Thanks
Dan
song.s() is not a function (or not available in demo mode)
And should songs.s be the directory where all the sound effects are stored.
Knowing me, I have done something wrong, but I an not sure what.
Thanks
Dan
Re: Problem
I didn't supply a complete code example, I had thought that you only lacked an understandng on the use of SetFileDate(). You can add this on to the beginning of the code sample I gave previously. You'll still need to tailor the code with information regarding your songs.dannyboy99 wrote:I tried this, but I get an error message saying
song.s() is not a function (or not available in demo mode)
And should songs.s be the directory where all the sound effects are stored.
Knowing me, I have done something wrong, but I an not sure what.
Thanks
Dan
Code: Select all
#numberOfSongs = 30
DataSection
songList:
Data.s "C:\Song.mp3","C:\Song2.mp3" ;add each song, 30 total
EndDataSection
Dim songFilenameArray.s(#numberOfSongs)
Restore songList
For i.l = 1 To #numberOfSongs
Read songFilenameArray(i)
Next
-
- User
- Posts: 27
- Joined: Sun Jul 13, 2008 9:47 am
- Location: UK
Thanks
Thanks very much for those who helped me here especially Demivec
I have finsihed the programs, which seem to working well.
Thanks again
Danny
ps One thing I found was that i could alter the dates of the files, great, but when i copied them it used todays date as creation date.
Is this something the PB does
I have finsihed the programs, which seem to working well.
Thanks again
Danny
ps One thing I found was that i could alter the dates of the files, great, but when i copied them it used todays date as creation date.
Is this something the PB does