Search found 189 matches

by trenatos
Mon Mar 10, 2014 4:33 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Dynamic variable in Repeat?
Replies: 9
Views: 1249

Re: Dynamic variable in Repeat?

Yes! That did the trick, and now I know how to make dynamic variables :)
by trenatos
Mon Mar 10, 2014 4:12 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Dynamic variable in Repeat?
Replies: 9
Views: 1249

Re: Dynamic variable in Repeat?

Hi Simon,

I tried but it breaks with; no such object near "price", char 7

Basically I'm just trying to sum up 15 price-fields and display a total.
by trenatos
Mon Mar 10, 2014 3:56 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Dynamic variable in Repeat?
Replies: 9
Views: 1249

Dynamic variable in Repeat?

I have a stack with 15 fields, and I'm hoping to create a dynamic repeat for doing some basic math. The code below does not work, but should show what I'm trying to achieve (The fields are named price1 - price15) Is this possible in LC? Repeat with counter = 1 to 15 put field "price" & counter + tem...
by trenatos
Fri Mar 07, 2014 10:14 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Thierry, I owe you a beer, thank you very much for the help with this issue :)
by trenatos
Fri Mar 07, 2014 10:12 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Btw, that regex works without the field!

repeat while matchChunk( T, "(?msi)(\$(\w+=\"\w+\");)", p1start,p1End,p2Start,p2End)

Works just fine!

(I don't understand that regex, but that just means I'll spend time figuring out how it works :)
by trenatos
Fri Mar 07, 2014 10:08 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Sorry, yes, I edited my last post to reflect that I finally saw your regex in the comment
by trenatos
Fri Mar 07, 2014 10:04 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Almost ;) Your function actually replaces the variable $color="red"; with this: $<cfset >; --edit-- waaaait, I forgot to chang the field to the regex in your comment, it totally works now, you have no clue how much that saved my sanity, I can actually continue this project idea now. I'm curious abou...
by trenatos
Fri Mar 07, 2014 9:45 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Live and learn, ok so gotIt contains the string match, gotIt1 and gotIt2 are the positions of the first and last characters of the matched string. convText contains a block of php code. get matchChunk( convText, field "regField", gotIt1,gotIt2) put "\$" & gotIt & ";" into changeMe put replaceText( c...
by trenatos
Fri Mar 07, 2014 9:01 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Your first example replaced the string with $ding, but you're saying that () won't work. And I don't understand how the second example would let me replace the text with part of the matched text. Basically, I need to convert $color="red"; to <cfset color="red"> but dynamically, it should work with u...
by trenatos
Fri Mar 07, 2014 8:34 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Actually, even this should work at least for testing: put replaceText(convText,"\$(.*);", "blabla")

But nope. It doesn't throw an error, but it also doesn't match $color="red"; in the source text.
by trenatos
Fri Mar 07, 2014 8:17 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Sure, thanks for taking a look :) $color="red"; Grabs everything except the $ and ; for the replace (Dynamic interpretation of PHP variables) Sorry I should have clarified, I'm not blaming the Regex implementation but the compiler. I've had other issues with both the compiler and IDE (Like Undo not ...
by trenatos
Fri Mar 07, 2014 7:58 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Re: Regex help?

Hi Thierry,

You mean like this? put replaceText(convText, field "regField", "ding")

It's not working either, though no errors.

The issue is the LC compiler? :/

I'll sound like an ass but.. shouldn't something like that work in version 6.x? I mean, escaping characters is kind of common in regex.
by trenatos
Fri Mar 07, 2014 7:46 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Regex help?
Replies: 17
Views: 1695

Regex help?

I'm trying to figure out why this doesn't work. put replaceText(convText, "\$([a-z]*)=(\"[a-z]*\");", "ding") I'm getting this error: compilation error at line 6 (Function: separator is not a ',') near "[", char 30 It doesn't seem to want to escape the " with \ and I don't know why, everything I've ...
by trenatos
Wed Mar 05, 2014 9:33 pm
Forum: Feature Requests
Topic: IDE Block highlight
Replies: 0
Views: 760

IDE Block highlight

A small request that would make my day so much easier. A toggle function for highlighting the current block your cursor is in, in the editor. Just the words of the start and end block would need highlighting, but it would make it much fast to see the start and end of big blocks of code with nested b...
by trenatos
Sat Mar 01, 2014 11:53 pm
Forum: Feature Requests
Topic: See special characters in IDE
Replies: 3
Views: 1373

Re: See special characters in IDE

I know of ways *around* the problem, such as special fonts or copying into Notepad++, I'm just looking for a simple built-in solution you can toggle on/off to check for things.

Go to advanced search