Vertical Bar

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Vertical Bar

Post by richmond62 » Fri Apr 18, 2025 6:53 pm

I have a text file that contains "cheese|cheese" among its contents.

And I wonder why THIS throws a 'bluey':

Code: Select all

put 1 into VOXX
   repeat until VOXX > 500
      if word VOXX of fld "GUFF" contains "|" then
         put word VOXX of fld "GUFF"
      end if
      add 1 to VOXX
   end repeat

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Vertical Bar

Post by richmond62 » Fri Apr 18, 2025 7:30 pm

OK, that's working now. 8)

BUT this isn't:

Code: Select all

put 1 into VOXX
   repeat until VOXX > 500
      if word VOXX of fld "GUFF" contains "|" then
         put word VOXX of fld "GUFF" into ZOOP
         set the itemDelimiter to "|"
         put item 2 of ZOOP into ZAAP
         replace word VOXX of fld "GUFF" with ZAAP
      end if
      add 1 to VOXX
   end repeat

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10315
Joined: Wed May 06, 2009 2:28 pm

Re: Vertical Bar

Post by dunbarx » Sat Apr 19, 2025 8:09 pm

Richmond.

Syntax error for "replace". Should be:

Code: Select all

replace word VOXX of fld "GUFF" with ZAAP in fld "GUFF"
Craig

Post Reply