TAOW (Mojave and CREATE THUMBNAIL)
I want to see if this has already been reported but don’t see how to search for existing cases about Mac OS 10.14 in the TAOW. Running 10.14.1 with 16R6 if I do… CREATE THUMBNAIL($ImagePtr->;vThumbnail;98;120) vThumbnail displays slanted to the left with what looks like multiple images. At the risk of dating myself, it looks like an old TV who’s vertical control is FUBAR. John John Baughman Kailua, Hawaii (808) 262-0328 john...@hawaii.rr.com ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Using Preg Replace to replace tags
Thanks Jim! I could not get your solution to work with Rob's plugin, but it works perfectly with the Regex component which I found on the Forum - here's the link if anybody needs it: http://forums.4d.com/Post/EN/7161740/1/7161741 My test code: $source:="Some text.Set this text in bold please ." $Srchstring:="([^<]*)" $replacestring:="<@bold:>\\1<@:>" $err:=*Rgx_SubstituteText* ($Srchstring;$replacestring;->$source) Pat On Sun, 25 Nov 2018 at 03:34, Jim Crate via 4D_Tech <4d_tech@lists.4d.com> wrote: > On Nov 24, 2018, at 9:39 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > > > I'm attempting to use the Regex Plugin from Pluggers to replace tags > with different tags. > > For example, change this text: > > > > Some text.Set this text in bold please . > > > > to > > > > Some text.<@bold:>Set this text in bold please .<@:> > > > > In other words, there' a starting and ending tag with any kind if text in > > between. > > > > I've tried: > > > > $Srchstring:="[A-Za-z_0-9]" > > > > $replacestring:="@bold:[A-Za-z_0-9]<@:>" > > > > $t:=*Preg Replace*($Srchstring;$replacestring;$source) > > I didn’t download Rob’s plugin to check the manual, but regex replacing > works by using capture groups in the regex that the replace string > references. You’ll need to check the plugin manual for specifics, or the > example database. Capture groups are usually indicated with parenthesis, > and the references are usually \1, \2, etc, based on the order of > appearance of capture groups in the pattern. Sometimes they’re referenced > with $ instead of \. So it could be something like: > > $SrchString:="([^<]*)" > $ReplaceString:=“<@bold:>\\1<@:>” > > I used [^<] because that will match any characters except <, so it’s more > concise than listing all the acceptable characters, and also expresses the > intent better. If you have nested tags it won’t work, but I’m not sure if > nested tags can be handled with a simple regex pattern. > > The backslash reference in the replace string will probably have to be a > double-backslash. Because double backslashes is annoying, Rob might have > used a different referencing scheme. You’ll want to check the manual. > > > Jim Crate > > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** -- * CatBase - Top Dog in Data Publishing tel: +44 (0) 207 118 7889 w: http://www.catbase.com skype: pat.bensky * ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Using Preg Replace to replace tags
On Nov 24, 2018, at 9:39 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote: > > I'm attempting to use the Regex Plugin from Pluggers to replace tags with > different tags. > For example, change this text: > > Some text.Set this text in bold please . > > to > > Some text.<@bold:>Set this text in bold please .<@:> > > In other words, there' a starting and ending tag with any kind if text in > between. > > I've tried: > > $Srchstring:="[A-Za-z_0-9]" > > $replacestring:="@bold:[A-Za-z_0-9]<@:>" > > $t:=*Preg Replace*($Srchstring;$replacestring;$source) I didn’t download Rob’s plugin to check the manual, but regex replacing works by using capture groups in the regex that the replace string references. You’ll need to check the plugin manual for specifics, or the example database. Capture groups are usually indicated with parenthesis, and the references are usually \1, \2, etc, based on the order of appearance of capture groups in the pattern. Sometimes they’re referenced with $ instead of \. So it could be something like: $SrchString:="([^<]*)" $ReplaceString:=“<@bold:>\\1<@:>” I used [^<] because that will match any characters except <, so it’s more concise than listing all the acceptable characters, and also expresses the intent better. If you have nested tags it won’t work, but I’m not sure if nested tags can be handled with a simple regex pattern. The backslash reference in the replace string will probably have to be a double-backslash. Because double backslashes is annoying, Rob might have used a different referencing scheme. You’ll want to check the manual. Jim Crate ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Be willing to be a beginner with ORDA
Miyako wrote this in another post recently: "Form" based design is a total rethink of how to use variables in forms. Form is an object, and an object is a reference, which drastically reduces the need for pointers. historically a pointer can only point to tables, fields, variables and arrays. it could have been extended to support object properties and collection members but that would send the wrong message. if you use Form and This, you should never want to use pointers. you should think of using object notation consistently in code and form. this is not to say that "generic" code is discouraged in ORDA. you just think of how to be generic in a different way. it feels counter intuitive coming from classic 4D code, but hard-coding object property paths everywhere is the key to writing generic and reusable code. I think this outlines where we, experienced 4D developers, find ourselves with respect to how, why, and if we want to incorporate ORDA and the whole object-oreiented (or psuedo OO, as some hold) into our work. I hear folks bemoan how hard it is to make ORDA do what they want within the context of a 20 year old app. And why it's not faster than native 4D. And how it's not compatible with SQL. True to all that. And if those elements are crucial to a project it's not a good candidate for ORDA. ORDA is good if you have the time and inclination to learn a new language. Deciding to learn a new language is not a trivial thing. You have to learn the rules, the syntax, the grammar, the ways of doing things specific to that language. This is what ORDA presents. It's even more challenging for experienced devs, I think, because it's right there next to the things we are so familiar with. I'm a big fan of ORDA. And I'm still learning. I've put hours into making something work using Form, collections and references only to come back to it after figuring out something else to discover say 600 lines of code can actually be reduced to 200 because I wasn't fully appreciating how to use references. Learning to use ORDA requires being willing to be a beginner again. The payoff for me is programming with ORDA is faster. It's more dynamic. With respect to a question Miyako was responding to about creating generic code the approach I'm working with is to create objects with common properties that are passed to methods expecting those property names. This doesn't mean you have to re-name your table fields but that you simply construct an object with references to your fields or form vars to properties named as expected. Doing this sort of thing in ORDA is very easy. Doing it in classic 4D isn't. For instance, think about an Invoice. Aside for demos an Invoice will likely involve a number of other tables: Customer, Vendor, items, payments and and so on. In classic 4D we deal with each of those discretely. With ORDA I can build a single object for Invoice which includes references to all of those elements. That can be done on the server and passed to the client - a big efficiency improvement over a network. A single form is therefore able to idsplay all aspects of Invoice from that one object. This is a time sensitive object, of course. But so is loading all that related data into listboxes and form fields. There's also the benefit of being able to write a single calculation method to function on the object whether it's displayed in a form or not. I encourage you to approach ORDA as a new language. There's a lot familiar in it but it really is a different way of thinking about how we do things in 4D. -- Kirk Brooks San Francisco, CA === *We go vote - they go home* ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Using Preg Replace to replace tags
I'm attempting to use the Regex Plugin from Pluggers to replace tags with different tags. For example, change this text: Some text.Set this text in bold please . to Some text.<@bold:>Set this text in bold please .<@:> In other words, there' a starting and ending tag with any kind if text in between. I've tried: $Srchstring:="[A-Za-z_0-9]" $replacestring:="@bold:[A-Za-z_0-9]<@:>" $t:=*Preg Replace*($Srchstring;$replacestring;$source) and some variations such as $Srchstring:="[\\d\\w\\s]" $replacestring:="<@bold:>[\\d\\w\\s]<@:>" $t:=*Preg Replace*($Srchstring;$replacestring;$source) But they don't work ): Any suggestions as to what I'm doing wrong? Pat -- * CatBase - Top Dog in Data Publishing tel: +44 (0) 207 118 7889 w: http://www.catbase.com skype: pat.bensky * ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **