Subscribe to this thread
Home - General / All posts - Troubleshooting list for scripts (bis)
lionel

995 post(s)
#26-Nov-21 07:54

It is about Troubleshooting list for scripts (georeference.org)

What the problem about 2 differents SQL script that call 2 differents script file ( name extnesion and location ) with the same content ?

I understand that

1) only the file that is inside map is inside manifold database db ( mfd_data & mfd_root) .

2) that we refer to the files using differents syntax ' Sample..cs ' ( external) or [Sample] ( inside *.map)

Can i have more information , i don't understand !

Thank's

NB Does the content of file script inside manifold use utf-8 ?

Attachments:
callsame_script_internal_external.png
callsame_script_internal_external1.png


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

adamw


10,447 post(s)
#29-Nov-21 14:04

FUNCTION ... AS SCRIPT [abc] ENTRY ...; -- this refers to a script component named 'abc' in your project.

FUNCTION ... AS SCRIPT FILE 'abc.cs' ENTRY ...; -- this refers to a script file named 'abc.cs' somewhere in the Manifold folders (first we check either ~\bin or ~\bin64, depending on whether you are running the 32-bit or the 64-bit version of MANIFOLD.EXE, and we check both the folder and all its subfolders, then we check ~\shared and all its subolders, and finally we check two more folders which we will likely stop checking in the future, but for now they work: ~\Manifold\v9.0 in the machine-wide application data folder and ~\Manifold\v9.0 in the user-specific application data folder).

Script text in MAP files is stored as Unicode text (NVARCHAR), this is currently using UTF16, but we are going to switch to UTF8 in the future, yes.

lionel

995 post(s)
#12-Jun-22 07:07

when run the 2 queries that should return the path of the *.map file :

-query "call_internal" that call the script "Sample" return path C:\WORK\is\test\Mapfilepathtest.map ( OK)

-query "call_external" that call the script "C\Manifold\Shared\Sample.cs" return the same path ( OK) [ edit because was BAD]

is this the expected result for the 2 queries ?

B) MapFilePath() C# function has 2 defininitions . How we know which is call by Query ?

public static string MapFilePath(Manifold.Application app, Manifold.Database db)

public static string MapFilePath()

C) in mfd_meta pink row

7 is Sample.cs ?

8 is [Sample] ?

thank's

Attachments:
call_external_error.png
call_internal_result.png
Mapfilepathtest.map


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

adamw


10,447 post(s)
#14-Jun-22 12:24

A - If the external script (the SAMPLE.CS file) is the same as the internal one (the Sample component in the MAP file), then yes, running the external script should return the same path to the MAP file as the internal. Because the MAP file is the same in both situations.

B - The query engine picks the second definition based on the argument types / return type declared for the query function.

lionel

995 post(s)
#12-Jun-22 07:30

For C) question : the content inside sample (sample.cs or [Sample] begin both by //C#

Does any filename.cs inside shared directory could appear in mfd_meta ?

D) Is there a way to clean the mfd_meta TABLE ?

E) now script component use UTF-8 ?

Attachments:
mfd_meta_docleaning.png


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

adamw


10,447 post(s)
#14-Jun-22 12:28

C - Scripts in external files do not appear in MFD_META of any MAP file. They are referenced by filename.

D - How to clean MFD_META? You can simply delete the records you don't want to have. You can also right-click a specific component in the Project pane, select Properties and delete one or more of its properties, that's a different way of deleting records from MFD_META.

E - Scripts and other text components are generally stored as Unicode text (I say generally, because sometimes the data source does not support Unicode text and then we are using ANSI). The encoding does not matter, it's an implementation detail that can (and likely will) change. Right now, in MAP files, it's UTF16.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.