|
Post by (X) on Dec 15, 2023 18:24:42 GMT 1
PROBLEM: Dim dbg = 1 // or "Dim dbg as Variant = 1" Eventually returned "Error: Access-Violation"
SOLUTION: Dim dbg as Single = 1
TAKE HOME MESSAGE:
OTHER COMMENTS:
|
|
|
Post by scalion on Dec 26, 2023 12:41:51 GMT 1
Le problème dans le développement des librairies est que les erreurs de violation peuvent survenir sans que cela ai un rapport avec le type de variable. Il s'agit d'un véritable bug, j'en ai parlé avec Sjouke et il y a un problème structurel dans la compilation des librairies. On peut très bien avoir un code qui plante à un endroit précis et il suffit d'insérer une autre procédure ailleurs dans le code qui n'a rien à voir pour que tout rentre dans l'ordre. Pas d'explication pour l'instant .
|
|
|
Post by (X) on Dec 26, 2023 15:07:25 GMT 1
Merci pour ces commentaires scalion. Translation:
Another tidbit from (X)
|
|
|
Post by scalion on Jan 29, 2024 9:38:20 GMT 1
Pour info, I have just coded a small library for shaders, and I encountered the following problem: "Error Access Violation etc..."
The problem in this case was the use of literal values: a = 0.5 + 4.9999 * b / 3.141592 // cause error
To resolve this problem I declared local variables in the function:
local double c = 0.5 local double d = 4.9999 local double p = 3.141592
a = c + d * b / p // work fine !
I think it's an incorrect jump with litteral value when the expression is compiled.
|
|
|
Post by (X) on Jan 29, 2024 11:30:05 GMT 1
I have been wrestling with this issue for years and trying to come up with an exact solution for: "What does and doesn't work in library code".
You might also get away with using a conversion function such as: Cdbl() for every literal. For example:
Local Double b = 1 Local Double a = Cdbl(0.5) + Cdbl(4.9999) * b / Cdbl(3.141592)
|
|