Re: JPR_Text2Pict and Objects, a perfect engagement...

2017-02-20 Thread Wayne Stewart via 4D_Tech
Hi,

How can you embed a carriage return so you can have multiple lines?

Regards,

Wayne


Wayne Stewart
about.me/waynestewart




On 9 November 2015 at 04:38, JPR  wrote:
> [JPR]
>
> Hi All,
>
> The first version of JPR Text2Pict method has been made in 2000. It's purpose 
> was to convert a Text into a Picture, with the possibility  to select Font, 
> Style, Size, Color, etc. It was using a Blob inside which the Picture was 
> build as a PICT by using QuickDraw commands, and then converting the Blob 
> into a Picture.
> Today, QuickDraw is dying *Sigh* along with the PICT format. Although the 
> possibilities of Multistyle Text, added to the colossal enhancement of List 
> Boxes, reduce the need for this method, there are still a lot of cases where 
> it's easier to deal with a Picture than a Text.
>
> This example uses SVG commands in order to build the Picture from the Text 
> with the possibility to select the  Font, Size, Style(s), Text Color, 
> Background Color, Rotation, Alignment, Opacity, etc.
>
> It also illustrates the use of JSON-type 4D Objects to pass parameters to a 
> Function in a lazy way, in order to simplify the code.
>
> You will find this example, named JPR_Text2Pict.4dbase, at the same place 
> than Emoji database, here:
>
> ftp://JPR:xjlr...@ftp-support.4d.fr/
>
> How to use it? Extremely simple! Just run the Test_Text2Pict Form, play with 
> it, and read the code!
>
> - In the JPR_Text2Pict Method, during the Init phase, set up the Default 
> Values of your choice, the method is fully documented in comments.
>
> - If you want to keep these default values in a Process Variable, just call 
> the Method once:
>
> C_OBJECT(myObject)
> OB SET(myObject;"xText_Text";vText)
> vPict:=JPR_Text2Pict (->myObject;"INIT")
>
> - Before calling the method, modify whatever Properties you want to. For 
> instance, changing the Text,  the Font, and the Size, then getting the 
> Picture:
>
> OB SET(myObject;"xText_Text";"My text to use")
> OB SET(myObject;"xText_font_family";"Palatino")
> OB SET(myObject;"xText_font_size";18) //or "18", it doesn't matter
> vPict:=JPR_Text2Pict (->myObject)
>
> And the job is done!
>
> Here also, like for Emoji, it's a gift, so enjoy it, and feel free to use it 
> as much as you want. A Technote will come soon to explain everything in 
> detail.
>
> My very best,
>
> JPR
>
> PS: Many thanks to Vincent de Lachaux for the SVGTool_SHOW_IN_VIEWER, and to 
> Roland Lannuzel for it's Great Rotating Ruler!
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Detecting field properties that can take nulls

2017-02-20 Thread Jeremy French via 4D_Tech
Hi Bob,

I believe you can locate the fields — whose “Map NULL values to Blank values” 
is unchecked — by exporting the structure.

Try this:

1) Export the structure in HTML format.

2) Then open export in a browser, and look in the column titled “Never Null”. A 
check-mark in the “Never Null” column indicates that the field has "Map NULL 
values to Blank values” check-marked.

3) Any row **without** a check-mark is a field that has “Map NULL values to 
Blank values” unchecked. (There is one exception: UUID fields appear unchecked.)

There is also another column in the report titled “Never Null”. A check-mark in 
the “Never Null” column indicates that the field property “Reject Null value 
input” is check-marked.

I believe your SQL search below is locating fields that are check-marked for 
“Reject Null value input”, which is **not** what you intended to look for. You 
want to locate fields for which the “Map NULL values to Blank values” is 
unchecked. Exporting the structure to HTML, and examine the “Never Null” 
column. Fields without a checkmark (other than UUIDs) will be fields whose "Map 
NULL values to Blank values” is unchecked.

See the following for UUID fields:
http://doc.4d.com/4Dv16R2/4D/16-R2.1620/Field-properties.300-3123226.en.html#Paragraph_106190

Best regards,
Jeremy French


> On Feb 20, 2017, at 2:52 PM, bob.miller--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I found that I had inadvertently 
> unchecked "Map NULL values to Blank values" on a field definition.  I'd 
> like to scan the database to see if I may have made the same mistake for 
> any other fields.

and

> ARRAY TEXT($aTableName;0) 
> ARRAY TEXT($aColumnName;0) 
> 
> Begin SQL 
> select TABLE_NAME, COLUMN_NAME 
> from _USER_COLUMNS 
> where NULLABLE = true 
> into :$aTableName, :$aColumnName; 
> End SQL 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Survey on 4D’s strategy for implementing Preemptive Processing / worker processes

2017-02-20 Thread Robert ListMail via 4D_Tech
Jim, are you using Ruby/Rails with 4D in any way…?

Thanks,

Robert

> On Nov 3, 2016, at 8:11 PM, James Crate  wrote:
> 
> Ruby/Rails apps - processing large numbers of files; performing slow fuzzy 
> search on slices of data; 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Vexing, un clear SQL error

2017-02-20 Thread Kirk Brooks via 4D_Tech
Tim,
I am also thinking about setting a semaphore at the start and end - but
that seems like the wrong path because I can't believe the SQL server can
only accomodate one operation from the entire database at a time.

On Mon, Feb 20, 2017 at 12:57 PM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The Error Stack caught my eye. To me it indicates 4D Server, for whatever
> reason, did not respond in an expected way. Maybe it was not quick enough.
> Maybe 4D Server and the SQL Server was a bit busy at that exact point in
> time and thus returned error 1009 which then cascaded to error 1002.
>

-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Vexing, un clear SQL error

2017-02-20 Thread Kirk Brooks via 4D_Tech
Hi Tim,
Yeah, I was wondering about that error code too. It hadn't occurred to me
the problem could be the transit lag between the client the server but that
would account for what I'm seeing. Interesting idea about the wrapper.
Maybe I'll make a specific error handling method for these sorts of
functions...

BTW this is v15.4. The clients seems to be most windows machines.

Thanks for the insight.

On Mon, Feb 20, 2017 at 12:57 PM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> The Error Stack caught my eye. To me it indicates 4D Server, for whatever
> reason, did not respond in an expected way. Maybe it was not quick enough.
> Maybe 4D Server and the SQL Server was a bit busy at that exact point in
> time and thus returned error 1009 which then cascaded to error 1002.
>
> You said this code is called many hundreds of times each day, yet
> occasionally if fails. So the program code is good and passing it bad data
> in $partner_id should not cause an error like this.
>
> I would suggest you write a wrapper method for this code and check for the
> 1002 or 1009 error code returned. If you get that, just wait a bit and try
> again. Maybe try 3 times before you give up.
>
> Maybe do a PAUSE PROCESS(Current process;10) to wait 1/10 of a second,
> then run the code again and if there is still an error, repeat. Keep an
> error count so when you reach your limit of 3 attempts, then you record the
> error to your error logging and to the user.
>
> I would also record a special info type message every time you run into
> this situation where you have to try more than once and record success or
> failure and the number of attempts. Then you’ll be able to track how often
> this fix/hack is working and being successful. You might find you need to
> try 5 times before it is always successful.
>
> I had to implement a similar fix/hack for a situation where I was checking
> if a shared folder was mounted using the “Test path name” command.
> Sometimes it would report the share was not available, but it really was.
> If you did the same operation a second time it worked. By simply checking
> several times in a row if the first Test path name failed solved the
> problem and eliminated the user seeing any error message.
>
> For anyone interested, this error can occur when you are using macOS 10.7
> to share a directory with a Windows user via SMB. Apple threw out SAMBA as
> their Windows SMB code base and wrote their own from scratch with 10.7.
> Whatever they did caused this issue for me. Might have been fixed in later
> macOS versions.
>
> Tim
>
> 
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> timnev...@mac.com
> 
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **




-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Detecting field properties that can take nulls

2017-02-20 Thread Keisuke Miyako via 4D_Tech
the way forward is EXPORT STRUCTURE,
which gives you an XML representation of the structure in full detail.

read http://blog.4d.com/detailed-analysis-database-structure/

includes a utility that converts the XML to JSON.

> 2017/02/21 4:52、bob.miller--- via 4D_Tech <4d_tech@lists.4d.com> のメール:
> Any ideas?




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Detecting field properties that can take nulls

2017-02-20 Thread Jeremy French via 4D_Tech
Have you looked at the SQL system table “_USER_COLUMNS”?

See: http://doc.4d.com/4Dv16/4D/16/System-Tables.300-3201182.en.html 



> On Feb 20, 2017, at 2:52 PM, bob.miller--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I've also dug through the SQL reference, and I'm not seeing any way to see 
> field attributes. 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Vexing, un clear SQL error

2017-02-20 Thread Kirk Brooks via 4D_Tech
**Apologies for double posting - just noticed I neglected to add a subject.

I need some help with this from some of you SQL gurus.

Here's a simple look up function (Partner_get_name) that uses SQL:

If ($partner_id>0)

If ([PARTNERS]ID#$partner_id)

Begin SQL

SELECT

Name_dba,

Name_display,

Name1_first,

Name1_middle,

Name1_last,

Name2_first,

Name2_middle,

Name2_last,

Type_Entity,

__ROW_ID


FROM PARTNERS

WHERE PARTNERS.ID  = :$partner_id


INTO

:$dba,

:$display,

:$n1_first,

:$n1_middle,

:$n1_last,

:$n2_first,

:$n2_middle,

:$n2_last,

:$entity,

:$recNum ;

End SQL . <= Line 51

​End if

End if​

​I've trimmed out the declarations and such for clarity and because I don't
think they are the issue. This is a method that gets called a lot. I dare
say several hundred times a day, probably more. But I keep seeing 1 or 2
errors. Here's a sample error report:

​Partner_get_name :
[db engine] Invalid table number requested by a Plug-In
  Error #   -1
  Line  #   51
  Process:11 [ORDER_EDIT_RECORD]_ORDERS_124045
  Environment:[RM C]
  Session:
{"id":32044,"userName":"***","4dUser":"***","dbUser":-26,"
userId":4048,"machine":"***","machineName":"***_sched","partnerId":130646,"
boundPartnerId":101,"boundVendorId":101,"salesRepId":4177,"registerId":
"***_32044"}
  Error Stack:
1002 : SQCO; Failed to connect to the remote server.
1009 : SQLS; Remote SQL Server is not available.


There's nothing in the info from 4D that helps me. The table is clearly
valid. But I'm not entirely clear what the SQL errors are trying to tell
me. I've attempted to recreate the error by feeding the method various
levels of junk but I can't get it to barf.

Any ideas?

-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Detecting field properties that can take nulls

2017-02-20 Thread bob.miller--- via 4D_Tech
Hello All,

In troubleshooting a recent problem, I found that I had inadvertently 
unchecked "Map NULL values to Blank values" on a field definition.  I'd 
like to scan the database to see if I may have made the same mistake for 
any other fields.

I'm coming up short on a way to do that using Get Field Properties.  I 
don't want to scan every record of every field of every table, all I want 
to do is find whether my structure definition is wrong.

I've also dug through the SQL reference, and I'm not seeing any way to see 
field attributes. 

Any ideas?

Many thanks -


Bob Miller
Chomerics, a division of Parker Hannifin Corporation



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: How to not close all windows on restart - v16

2017-02-20 Thread Douglas von Roeder via 4D_Tech
I've uploaded some pix of a "workspace palette" that I use.

It doesn't solve the issue that Kirk has reported but it is a handy
creating open groups of methods. In the first pix
, work is tracked at
the issue level so it allows me to quickly open groups of methods that were
used for any given issue. The second pix
 is from a
multi-developer environment where we differentiate our workspaces by naming
each workspace with the initials of the programmer.

The grid at the top lists the different workspaces which, when clicked on,
reveal the method names that belong to the workspace. Double clicking the
workspace name opens the listed methods, each method in its own window.

Nothing fancy but highly effective.


--
Douglas von Roeder
949-336-2902

On Sun, Feb 19, 2017 at 4:52 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I understand.
>
> my post was in reply to Kirk's comment (4DPOP constants module to restart)
> but sure, I would imagine there is no difference how the same command is
> used,
> inside a component or directly.
>
> > 2017/02/20 7:09、David Adams via 4D_Tech <4d_tech@lists.4d.com> のメール:
> > I'm not using 4D Pop in this case, I'm calling this line of code:
> > *OPEN DATABASE*(*Structure file*)
>
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - 202 user processes on server, 1 client

2017-02-20 Thread Chip Scheide via 4D_Tech
various user side tasks/processes.

On Mon, 20 Feb 2017 08:43:24 -0800, Kirk Brooks via 4D_Tech wrote:
> Chip,
> Did you note what they were doing?
> 
> On Mon, Feb 20, 2017 at 8:39 AM, Chip Scheide via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> I was just looking at the server computer for another reason not
>> related to 4D.
>> The console window of 4D server was showing 202 user processes. There
>> is/was 1 user connected, me.
>> There were NO open user processes on the client side.
>> I attempted to 'Abort' some of the processes - to no effect.
>> I did not notice any performance issues(s).
>> 
>> I restarted the server, to return the system to a 'normal' state.
>> 
>> WTF is going on?
>> 
>> Thanks
>> Chip
>> 
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> 
> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

v13 - 202 user processes on server, 1 client

2017-02-20 Thread Chip Scheide via 4D_Tech
I was just looking at the server computer for another reason not 
related to 4D.
The console window of 4D server was showing 202 user processes. There 
is/was 1 user connected, me.
There were NO open user processes on the client side.
I attempted to 'Abort' some of the processes - to no effect.
I did not notice any performance issues(s). 

I restarted the server, to return the system to a 'normal' state.

WTF is going on?

Thanks
Chip

---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Corrupted Explorer Window

2017-02-20 Thread Vincent de Lachaux via 4D_Tech
You can close it and then reopen it with the shift key down.

v i n c e n td el a c h a u x

Bee green - keep it on the screen





> On 17 Feb 2017, at 02:07, Sujit Shah via 4D_Tech <4d_tech@lists.4d.com> wrote:
>
> The 4D Explorer window has gone all funny on me.
>
> It is displaying in a small area correctly but not maximising.
>
> Tried deleting preferences etc
>
> Did not fix
>
> http://kb.4d.com/assetid=77026
>
>
>
> --
>
> xxx
> "There must be ingenuity as well as intention, strategy as well as
> strength. "
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**