| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		TwinHamster ♫ Furious souls, burn eternally! ♫
 
 
  
  Joined: 07 Mar 2004 Posts: 1352
 
  | 
		
			
				 Posted: Tue Jun 26, 2007 5:31 pm    Post subject: Question involving using Strings to work | 
				     | 
			 
			
				
  | 
			 
			
				After looking through near every article on strings on the wiki and on the past three pages of this forum, I have yet to get them to work.
 
 
Even with the simplest example given from the wiki:
 
 	  | Code: | 	 		  
 
$1 = "Hello "
 
$2 = "Bob"
 
 
$1 += 2
 
 
show string (1) #this will show the string "Hello Bob" | 	  
 
 
When compiled, will give me a:
 
 	  | Errors and Warnings wrote: | 	 		  
 
Unrecognized name $1="hello". It has not been defined as script, constant, variable, or anything else.
 
 | 	  
 
So I'd just like to know, what am I missing that's preventing me from using strings?
 
 
Alternatively, I've had to use a series of [Append Ascii]; however, this becomes troublesome when every string is a single letter (as I have no alternative way to merge strings together).
 
 
Help please :_; | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Ysoft_Entertainment VB Programmer
 
 
  
  Joined: 23 Sep 2003 Posts: 810 Location: Wherever There is a good game.
  | 
		
			
				 Posted: Tue Jun 26, 2007 6:29 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Make sure you got the latest plotscr.hsd and the latest hspeak
 
 
Hopefully this helps. _________________ Try my OHR exporter/importer.
 
OHRGFX
 
Striving to become better pixel artist then Fenrir Lunaris.  Unfortunately the laziness gets in the way of my goals. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		TwinHamster ♫ Furious souls, burn eternally! ♫
 
 
  
  Joined: 07 Mar 2004 Posts: 1352
 
  | 
		
			
				 Posted: Wed Jun 27, 2007 5:14 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Whoops.
 
I guess I should be mentioning that I'm using the latest nightly everythings. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Bob the Hamster OHRRPGCE Developer
 
 
  
  Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
  | 
		
			
				 Posted: Wed Jun 27, 2007 6:39 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | TwinHamster wrote: | 	 		  Whoops.
 
I guess I should be mentioning that I'm using the latest nightly everythings. | 	  
 
 
 	  | Code: | 	 		  | Unrecognized name $1="hello". It has not been defined as script, constant, variable, or anything else. | 	  
 
 
The error message means that you are not using the latest hspeak. You have to download it separately from the nightlies of game and custom. http://hamsterrepublic.com/ohrrpgce/nightly/hspeak-win-nightly.zip
 
 
If you run hspeak with no command-line option, you should see this help screen:
 
 
 	  | Code: | 	 		  
 
HamsterSpeak semicompiler v3Gc (C)2002 James Paige&Hamster Republic Productions
 
Please read LICENSE.txt for GPL License details and disclaimer of liability
 
HSPEAK.EXW [-cdfksawyz] source.hss [dest.hs]
 
 
   -c colors will be disabled
 
   -d dump debug report to hs_debug.txt
 
   -f fast mode. disables some optimization
 
   -k do not wait for a keypress when finished
 
   -s print the name of each script as it is compiled
 
     -a same as -s, but including autonumbered scripts
 
   -w suppress minor warnings
 
   -y overwrite the destination file without asking
 
   -z write error messages to hs_error.htm
 
 
For more info about Hamsterspeak visit http://HamsterRepublic.com/ohrrpgce
 
 
This is a command-line program. You should either run it from the command-line 
 
(DOS prompt) or you should drag and drop your script file onto it.
 
 | 	  
 
 
If your version is "v3Gc" and you are still seeing the error message, let us know. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		TwinHamster ♫ Furious souls, burn eternally! ♫
 
 
  
  Joined: 07 Mar 2004 Posts: 1352
 
  | 
		
			
				 Posted: Wed Jun 27, 2007 10:38 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				My version of hspeak is v3Gc.   
 
 
What's odd is that I can't seem to get this one script to work either my home laptop or my work computer. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner
  
 
  
  Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
  | 
		
			
				 Posted: Wed Jun 27, 2007 11:26 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				And you have the latest HSD?
 
 
Can you post the entire script? _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		TwinHamster ♫ Furious souls, burn eternally! ♫
 
 
  
  Joined: 07 Mar 2004 Posts: 1352
 
  | 
		
			
				 Posted: Wed Jun 27, 2007 12:01 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | Moogle1 wrote: | 	 		  And you have the latest HSD?
 
 
Can you post the entire script? | 	  
 
 
Latest .HSD (6/1/07), check.
 
 
And...That was the entire script.
 
 	  | Code: | 	 		  
 
script, unfunctional, begin
 
$1 = "Hello "
 
$2 = "Bob"
 
 
$1 += 2
 
 
show string (1) #this will show the string "Hello Bob"
 
end | 	 
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner
  
 
  
  Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
  | 
		
			
				 Posted: Wed Jun 27, 2007 1:20 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Hey, I can reproduce this. Here's my entire file:
 
 
 	  | Code: | 	 		  include, plotscr.hsd
 
 
script, unfunctional, begin
 
$1 = "Hello "
 
$2 = "Bob"
 
 
$1 += 2
 
 
show string (1) #this will show the string "Hello Bob"
 
end | 	  
 
 
It does the same thing with or without a define script. This smells like a bug in HSPEAK. _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		TwinHamster ♫ Furious souls, burn eternally! ♫
 
 
  
  Joined: 07 Mar 2004 Posts: 1352
 
  | 
		
			
				 Posted: Wed Jun 27, 2007 1:51 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Yay! I'm not alone. 
 
 
So...could anyone show me a script with strings that actually work? | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Bob the Hamster OHRRPGCE Developer
 
 
  
  Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
  | 
		
			
				 Posted: Wed Jun 27, 2007 2:00 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Oh, wow. The example on the wiki was all wrong. I just fixed it.
 
 
 
 
is wrong, and should be replaced by:
 
 
 
 
Which is silly because hamsterspeak is absurdly lenient about spaces everywhere else, so it shouldn't be strict about them in just one place. I filed bug 401 about this.
 
 
Second,
 
 
 
 
 is wrong, and should be:
 
 
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		TwinHamster ♫ Furious souls, burn eternally! ♫
 
 
  
  Joined: 07 Mar 2004 Posts: 1352
 
  | 
		
			
				 Posted: Wed Jun 27, 2007 2:05 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				I just tried this out, and I seem to be okay now.
 
 
Thanks for the help, guys.   | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		TMC On the Verge of Insanity
 
 
 
  Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
  | 
		
			
				 Posted: Thu Jun 28, 2007 12:00 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				No spaces between +", =", $+, $=, or any other operator like := or -- allowed. I guess we could allow whitespace between +, = and ", since they're not operators so much as magic tokens. People might start complaining about $ a += "b" next. _________________ "It is so great it is insanely great." | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Bob the Hamster OHRRPGCE Developer
 
 
  
  Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
  | 
		
			
				 Posted: Thu Jun 28, 2007 8:21 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | The Mad Cacti wrote: | 	 		  | No spaces between +", =", $+, $=, or any other operator like := or -- allowed. I guess we could allow whitespace between +, = and ", since they're not operators so much as magic tokens. People might start complaining about $ a += "b" next. | 	  
 
 
Right, =" is a magic tokens, not an operator. It is not implemented in the same way as other operators, is it?.
 
 
 
 
They aren't likely to realize that =" is an operator. Instead they are more likely to think that = is the operator, and that the "quotes" are just marking the string.
 
 
You and I know that there is no operator here at all, just some magic syntax that vaguely resembles operators. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		TMC On the Verge of Insanity
 
 
 
  Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
  | 
		
			
				 Posted: Sat Jun 30, 2007 9:53 pm    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Hmm, I was quite wrong. Spaces are allowed inside operators. Anyway, it's changed now. _________________ "It is so great it is insanely great." | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		 |