Game Maker Multiple variable error - runtime-error

My code is designed to rename a jpeg and capitalize the attributes in order to trick my Nintendo 3DS into thinking it took the image as a photo this code down here is the converter ran on a pc to convert an image to the right type and name.
Prefix = "HNI_";
Midfex = floor(random(9999));
Suffex = ".JPG";
gt_file=get_open_filename("jpeg image|*.jpg", "");
file_rename(gt_file, Prefix + Midfex + Suffex);
Where "Midfex" is, a random number with four digits is created.
and "Prefix" and "Suffex" are, they just what they are called and supposed to do.
When running the game, I get this error:
FATAL ERROR in
action number 1
of Mouse Event for Left Pressed
for object object0:
DoAdd :: Execution Error
at gml_Object_object0_LeftButtonPressed_1 (line 10) - file_rename(gt_file,Prefix + Midfex + Suffex)
There are probably too many variables in the "Rename_File" function. I have tried this on GameMaker 8.0 and it still does not work. How can I fix this?
I am using the standard version of GameMaker Studio, not the free version. I have attached a screenshot of my code in Gm:s Drive.Google.com/file/0b....

When you use + you are trying to add the number Midfex to Prefix and Suffix. Changing it to Prefix + string(Midfex) + Suffex should solve your issue as it is now in a string format.
Also for your convenience you can use irandom(9999) instead of floor(random(9999)) to achieve the same result for Midfex.

You cant use + between string and real.
Prefix = "HNI_";
Midfex = string(irandom(9999));
Suffex = ".JPG";
or
file_rename(gt_file, Prefix + string(Midfex) + Suffex);

Related

Quick way to go to object's type definition in Goland

I can do Ctrl+Shift+P (linux) in Goland on a variable name to get the type of object it is (in a tooltip). Is there a quick way to go to the definition of that type? Usually I have to type in the name again (either via search or tapping shift twice).
Ctrl (Command) + Shift + B or Ctrl (Command) + Shift + Left-click.
Please see: https://www.jetbrains.com/help/go/navigating-through-the-source-code.html#go_to_declaration

Is it possible to set a modifier as a QShortcut?

shortcut = QtWidgets.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Shift), MayaMainWindow)
shortcut.setContext(QtCore.Qt.ApplicationShortcut)
I have a system in place for overloading Maya shortcuts, as and when needed. I want to do this with the shift key, however simply writing it as above seems to do nothing. Not even an error message.
I have tried
QtGui.QKeySequence(QtCore.Qt.Key_Shift)
QtGui.QKeySequence(QtCore.Qt.Key_Shift + QtCore.Qt.SHIFT)
QtGui.QKeySequence(QtCore.Qt.Key_Shift + QtCore.Qt.NoModifier)
QtGui.QKeySequence(QtCore.Qt.Key_Shift + QtCore.Qt.NoButton)
I want to run a custom shortcut when only the shift key is pressed.

Is the format of QFont.toString() documented and/or stable across Qt versions?

The documentation for QFont.toString says that it returns "a comma-separated list of the attributes", but it doesn't specify what "the" attributes are or what order they come in. (Edit: the documentation has been updated so it now explicitly lists the attributes and their order.) I found an old question whose answer says that the attributes are:
font family, pointSizeF, pixelSize, QFont::StyleHint, QFont::Weight, QFont::Style, underline, strikeOut, fixedPitch, rawMode
But I can't find any authoritative source for this information (and also that answer is more than 10 years old and is about Qt4).
Is there any explicit documentation of the format of QFont.toString(), including which attributes it represents and what order they come in? Is it reasonable to assume that saving such a string and later using it with QFont.fromString() on a different version of Qt will work?
There is no documentation that indicates which attributes and the order in which they are serialized. Generally Qt does not indicate the order of how the Qt classes are serialized since they can vary but I think that in the case of QFont it should establish an explicit order so I recommend reporting it as a bug. Therefore, the only way to know the order is to check the source code:
// https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qfont.cpp?h=5.15#n2070
QString QFont::toString() const
{
const QChar comma(QLatin1Char(','));
QString fontDescription = family() + comma +
QString::number( pointSizeF()) + comma +
QString::number( pixelSize()) + comma +
QString::number((int) styleHint()) + comma +
QString::number( weight()) + comma +
QString::number((int) style()) + comma +
QString::number((int) underline()) + comma +
QString::number((int) strikeOut()) + comma +
QString::number((int)fixedPitch()) + comma +
QString::number((int) false);
QString fontStyle = styleName();
if (!fontStyle.isEmpty())
fontDescription += comma + fontStyle;
return fontDescription;
}
I think that if the format changes then Qt will implement the logic so that all formats are supported in a similar way as it does with QDataStream so in general you should not worry about it.
Late but ...
Inside the Qt6 QFont doc to method toString() the string content is described:
[https://doc.qt.io/qtforpython/PySide6/QtGui/QFont.html?highlight=qfont#PySide6.QtGui.PySide6.QtGui.QFont.toString]
However, it seems that when returning a QFont from QFontDialog (Python 3.9.4, Qt 6.2.2 via PySide6, OSX Big Sur) 2 additional parameters are provided before the last parameter ("Font style (omitted when unavailable)")
Also, there is only 1 PointSize value and PointSizeF seems no longer available.
Unfortunately I did not find the latest sources online ....

How to debug or log ASP.net pages

First off I am not a programmer or else I should probably know how to do this already. I have a situation where I am receiving an MS Jscript runtime 800a1391 indicating whereClause is undefined. I am fairly certain in previous portion of the ASP page it is attempting to gather values and is most likely failing to return values or is returning something like a null that is later breaking the script on this line.
Here is the line it is failing on:
{
url += "&chartType=" +chartType + "&selClause=" + selClause + "&whereTrendTimeClause=" + whereClause + "&TrendTypeForReport=" + TrendType + "&ReportDisplayType=" + Request("ReportDisplayType") + showModes + "&whereProtocolClause=" + protocolClause + "&groupClause=" + groupClause + "&joinClause=" + joinClause + "&groupIDClause=" + groupIDClause;
}
What I am trying to figure is how to output (either to text) or even printed to screen the returns each time the whereClause does something within this page. Even if I have to manually enter some bit of code for each instance of whereClause that is fine. I am not looking for an easy solution just a method that works and returns what I need which is a very verbose output. The reason a verbose output is needed is I can compare a working environment vs a non-working one. I just need to get the "logging" to work first.
thanks,
To monitor your variable and see what your variable have you can use Google Chrome, and opening by the Console (right click on the page, click Inspect Element, then Select Console) you can see the errors that you have on page.
And you can use the console.log() to write on it from your javascript code.
You can learn more on this tutorial - Debug the web

BizTalk SourceFileName becomes dehydrated

I'm trying to use a custom filename since i need to create two files (a backupfile) so i followed the following tutorial to create filename Here
now when i test this with DELCUS%MessageID%.txt everything works fine but when i change it to DELCUS%SourceFileName%.txt the interface becomes permanently dehydrated.
the only thing i do for the filename is this
fileName = "ContExt" + System.DateTime.Now.ToString();
Message_send_Belspeed_BeautDay_ContExt(FILE.ReceivedFileName) =
fileName;
is there any reason why the use of SourceFileName would cause this to dehydrate?
Found the issue.
after a while the interface did crash and the filename looks like
DELCUS2012 10:50:40.txt
having : in a filename is not good.
This is just a standard windows file naming limitation, you can't name your file using any of these characters "\ / : * ? " < > |". So obviously your instances are going to get stuck!!

Resources