Anthrazit

885 Reputation

13 Badges

5 years, 317 days

MaplePrimes Activity


These are questions asked by Anthrazit

I'm doing som XML readin, and need a bit help in using the HasChild function properly.

The attachment shows that using HasChild on a xmltree works fine, but I can't get i working when using it on a xmldocument. The latter is usually the case when you get when you read in from a file.

HasChild.mw

I think  the help file regarding searchtext should be more specific regarding the result of the search.

Using searchtext(pattern, string, range), the result will be an integer which indicates the position of the first character from the beginning of the range - not from the beginning of the string.

One of the examples actually shows that.

SearchText("ijklm", "abcdefghijklmnopqrstuvWxy", 5..-5);

How can I sort lists which have tables as entries, and decide upon which entry the sort should be based.

In the attached example each entry in the list has the values material, name and type.

  • How would I sort the list based on the material name for example?
  • Are there any better methods to define and store the data?

Listsort.mw

Just curious about an output in an if statement.

Why do I need to use Print() in an if statement, when I don't need it otherwise? Why doesn't "hei" show in the output of the attached example?

Printinloop.mw

I'm trying to readin a XML file, where some figures are attached a unit.

Here's part of the XML file.

When doing the readin and assigning the values to  a variable with AttributeValue, the type of the variable is a string.

How can I convert this string value ("10.*Units:-Unit(m)") to a number attached the defined units?

First 17 18 19 20 21 22 23 Page 19 of 26