Re: SVG add object question

2017-10-23 Thread Keith Culotta via 4D_Tech
  // A heads up about embedding a SVG area into another SVG area.
  // Getting the ID of the embedded object requires SVG Find element IDs by rect
  // It does not seem to work using SVG Find element ID by coordinates

$svg:=SVG_New 
$svgArea:=SVG_New 

SVG_New_text ($svg;"This is a test";10;10)
$interPicture:=SVG_Export_to_picture ($svg)
$svgPictureRef:=SVG_New_embedded_image ($svgArea;$interPicture;5;0;".svg")
SVG_SET_ID ($svgPictureRef;"SVG_Codec")

SVG_CLEAR ($svg)

$PicMain:=SVG_Export_to_picture ($svgArea)
SVG_CLEAR ($svgArea)

ARRAY TEXT($a_GetsOneID;0)
SVG Find element IDs by rect($PicMain;5;0;1;1;$a_GetsOneID)
$ID_IsEmpty:=SVG Find element ID by coordinates($PicMain;6;1)

ALERT("SVG Find element IDs by rect gets ="+$a_GetsOneID{1}+Char(13)+"SVG Find 
element ID by coordinates ="+$ID_IsEmpty)


// Keith - CDI

> On Oct 22, 2017, at 3:16 PM, Ortwin Zillgen via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> this works for me
> 
> 
> 
> 
> Regards
> O r t w i n  Z i l l g e n
> -
>    
>  
> member of developer-network 
> 
> **
> 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 - Renaming a Directory via code.

2017-10-23 Thread Chip Scheide via 4D_Tech
follow up on this:
Code :

  //utl_file_Convert_to_Posix
  // $1 - text - Path to convert

  //original :  
  //JorgeChB 2012-05-30   pathToUnix
  //JorgeChB 2015-02-05

  //Converts a Mac file path to a Posix form

  //RETURNS - text - converted path
  // • Created 3/24/15 by Chip - 
C_TEXT($Path;$Path)

$Path:=$1

$Path:=Replace string($Path;"/";"__-sLaSh-__")  //'a/b' -> 
'a__-sLaSh-__b'
$Path:=Replace string($Path;":";"/")  //'a:b' -> 'a/b'
$Path:=Replace string($Path;"__-sLaSh-__";":")  //'a__-sLaSh-__b' -> 
'a:b'
$Path:=Replace string($Path;"\\";"")  //'a\\b' -> 'a\\b'"
$Path:=Replace string($Path;" ";"\\ ")  //'a b' -> 'a\ b'
$Path:=Replace string($Path;"*";"\\*")  //'a*b' -> 'a\*b'
$Path:=Replace string($Path;"'";"\\'")  //'a'b' -> 'a\'b'
$Path:=Replace string($Path;"&";"\\&")  //'a&b' -> 'a\&b'
$Path:=Replace string($Path;"\"";"\\\"")  //'a"b' -> 'a\"b'
$Path:=Replace string($Path;"(";"\\(")  //'a(b' -> 'a\(b'
$Path:=Replace string($Path;")";"\\)")  //'a)b' -> 'a\)b'

$0:="/Volumes/"+$Path

On Fri, 20 Oct 2017 19:02:53 -0400, Chip Scheide via 4D_Tech wrote:
> Ill post mine on Monday. I got it from Jorge I think
> 
>> On Oct 20, 2017, at 4:30 PM, Chip Scheide 
>> <4d_o...@pghrepository.org> wrote:
>> 
  $command_t:="mv "+GetPOSIXfilePath ($folderPath_t)+" 
>>> had trouble here -
>>> apparently 4D's (v13) Convert path system to POSIX command - fails to 
>>> do what it is advertised to do.
>>> Fortunately I had a routine already written to do this.
>> 
>> That’s exactly why I wrote my own. I use the 4D Convert path system 
>> to POSIX command but then Replace String for all spaces to “\ “. 
>> That seems to make it work. 
>> 
>> Tim
>> 
>> 
>> Tim Nevels
>> Innovative Solutions
>> 785-749-3444
>> timnev...@mac.com
>> 
>> 
>> 
> 
> Hell is other people 
>  Jean-Paul Sartre
> **
> 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
**

Re: Export import all after a crash

2017-10-23 Thread Arnaud de Montard via 4D_Tech

> Le 23 oct. 2017 à 14:34, Jeremy French via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Hi Arnaud,
> 
> You can pause indexes during the SQL import with:

Thanks Jeremy. I should have read more… 

-- 
Arnaud 





**
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: Export import all after a crash

2017-10-23 Thread Jeremy French via 4D_Tech
Hi Arnaud,

You can pause indexes during the SQL import with:

Begin SQL
ALTER DATABASE DISABLE INDEXES;
ALTER DATABASE DISABLE CONSTRAINTS;
End SQL

and then after the import completes, restore indexes with:

Begin SQL
ALTER DATABASE ENABLE INDEXES;
ALTER DATABASE ENABLE CONSTRAINTS;
End SQL

Details at:
http://doc.4d.com/4Dv16R4/4D/16-R4/ALTER-DATABASE.300-3451136.en.html

- Jeremy French

> On Oct 23, 2017, at 6:45 AM, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> PAUSE INDEXES does not exist too, I suppose it may result in a faster import. 

**
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: Export import all after a crash

2017-10-23 Thread Arnaud de Montard via 4D_Tech

> Le 22 oct. 2017 à 23:17, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Or you could use in error call and simply skip the bad records. I would also 
> try opening I. C/S and use sql to fill a me empty data file you can use same 
> on error stuff. 


Finally I did like this:

• repair "standart" 
check records in table before/after = one record lost in one table (a proof 
that a guardian angel for the unconscious exists)

• export 
with SQL EXPORT DATA
That's just one line of code, as Pat said. 
Tim, pictures and blob are exported this way. 
The whole result is a folder whith some sub folders and files, it's very very 
very fast. 

• import 
just a bit more than one line: loop through table numbers, if the export folder 
above references the table, import the corresponding sql instructions file with 
SQL EXECUTE SCRIPT. 4D writes the same SQL that 4D understands (which is not 
true for other DB's, BTW)

•others, specific v12
Hopefully there is no object fields in that version…  
DISABLE TRIGGERS doesn't exist, so one may need some tool to "freeze" triggers 
(in case some "on insert" trigger refers to another table, due to the import 
order, it could cause errors). Moreover, executing triggers in such an import 
is out of interest. 
PAUSE INDEXES does not exist too, I suppose it may result in a faster import. 

Many thanks to all for your answers and comments! 

-- 
Arnaud de Montard 


**
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
**