Hadrian Posted October 26, 2010 Share Posted October 26, 2010 I have the following that i want to reference but i keep getting "t1,t2,t3,t4,t5"...where is my syntax wrong? //Sample instances t1 = Field("Cafe Name") + " " + "November 24"; t2 = Field("Cafe Name") + " " + "November 26"; t3 = Field("Cafe Name") + " " + "November 27"; t4 = Field("Cafe Name") + " " + "November 28"; t5 = Field("Cafe Name") + " " + "Thanksgiving"; loc = ""; for (i = 1; i <= 5; i++){ loc += Str("t" + i); } return loc; Link to comment Share on other sites More sharing options...
esmith Posted October 26, 2010 Share Posted October 26, 2010 I'm pretty sure your problem is: loc += Str("t" + i); I don't think you can reference a variable (t1) with another variable (i). Instead, perhaps you could write it as: //Sample instances t = ["November 24","November 26","November 27","November 28","Thanksgiving"]; loc = ""; for (i = 0; i < t.length; i++){ loc += Field("Cafe Name") + " " + t[i]; } return loc; Link to comment Share on other sites More sharing options...
Hadrian Posted October 26, 2010 Author Share Posted October 26, 2010 Duh....should know this....Thanks Eric. I got it working. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.