The Official Website of AgoraCart and Agora.cgi
AgoraCart.com Demos Download AgoraCart User Manuals & Wiki Gold Members Forum Go Gold Now! Gold Version Memberships

AgoraCart.com

About
Features
Download
Payment Gateways
Send a Donation
Founders Club
BLOG: News & Updates

Showcases & Demos

AgoraCart Demos
Shop Live Stores

Downloads & Add-ons

Gold Version Downloads
DBwizz Database Mgr.
AgoraCart.com Store

Help & Support

User Manuals
Gold Version Users Forum
Gold Version Chat
Tech Support
Certified Agora Pros
Certified Designers
Hire a Freelancer

Gold Version Members

Member Benefits
Join Today!
Gold Members Home
Gold Version Users Forum
Gold Version Chat Rooms
Gold Version Downloads

For Store Owners

Merchant Accounts
Cool Resources
Advertise Here
"Powered by" Logos
Web Hosting Search

Misc.

Contact Us
MEET's Talking Guide
The Ancient Greek Agora






AgoraCart Free User Forums

This is the official FAQ and Cool Tips guide For the AgoraCart shopping Cart software


Official Sponsors of the AgoraCart Project:

       


RegisterSearchFAQLog in
Reply to topic Page 1 of 1
Can't load description into an array
Author Message
Reply with quote
Post Can't load description into an array 
I've been wrestling with this problem for almost a week now, trying different options, without any success, unless I use Javascript, but that creates another set of problems.

Anyway, I'm trying to load the %%description%% data from the data file, which looks like this,
Black Blue Yellow Fuschia Purple Green Orange Purple
into an array which I want to parse into a <SELECT> field.

Here's my code:
<!--agorascript-pre
{ local ($str)="";
@arrayOfStrings = split(" ", "%%description%%");
$str .= "1st String=";
$str .= $arrayOfStrings[0];
$str .= "\n";
$str .= "2nd String=";
@arrayOfStrings = qw(%%description%%);
$str .= $arrayOfStrings[0];
$str .= "\n";

return $str;
}
-->

And here's what gets generated. As you can see, I've used 2 different Perl commands both of which are supposed to split a string into an array, and neither work.
1st String=Black Blue Yellow Fuschia Purple Green Orange Purple
2nd String=Black Blue Yellow Fuschia Purple Green Orange Purple

What should get generated is:
1st String=Black
2nd String=Black

Anyone have an idea why this isn't working? I'd appreciate any help.

Bob M

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum