This question already has answers here:
Blocks nested too deeply
(3 answers)
C++ Disable C1061 error - blocks nested to deep?
(1 answer)
Closed 11 months ago.
i have a piece of code:
for(int l=0; l<schedule_display_field->children_fields.size();l++){
auto field = schedule_display_field->children_fields[l];
int field_index = boq_interface->schedule->get_index_of_field(field);
if(field->get_data_type() == "number"){
if(field->id == "sr_num"){
multi_data_array.push_back(to_string(index));
index++;
}else{
multi_data_array.push_back(to_string((*i)->cells_data[field_index]->numberic_data));
}
}else if(field->get_data_type() == "image"){
multi_data_array.push_back((*i)->cells_data[field_index]->image_url);
}else if(field->get_data_type() == "text"){
multi_data_array.push_back((*i)->cells_data[field_index]->text_data);
}
}
here visual studio 2019 msvc is complaining:
Severity Error C1061 compiler limit: blocks nested too deeply at the line if(field->id == "sr_num"){
on looking for reasons, i found out that msvc does not allow nested blocks beyond 128 blocks, is there any way to change this setting in visual studio 2019 or maybe any other solution.
Related
This question already has answers here:
HAML - what does the "!=" operator do?
(3 answers)
Closed 4 years ago.
I discovered the following statement in a haml template:
!= render partial: 'path/to/partial'
What is the purpose of != in this context?
It is used for Unescaping HTML.
example:
= "<Hello>" will give <g;Hello>
but now using
!= "<Hello>" will give <Hello>
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have not experience in ObjectiveC (IOS) development but I've seen too many codes for curiosity and found some people using GOTO statement (JsonKit Library, some code games, etc), even the Apple's source code is known to use that (You can see here).
As I have learned in all my academic life, using GOTO is a very bad development pratice and must to be avoid, so why is it a "commom" pratice in IOS development, is there some special reason??
It is good programming style to use the break, continue, and
return statements instead of the goto statement whenever possible.
However, because the break statement exits from only one level of a
loop, you might have to use a goto statement to exit a deeply nested
loop.
*Source - Microsoft
One more example from the BLOG
MyExperience
Academic is good and nice, but, in real, practical bad world, may happens that you have to exit from 2 or 3 nested for cycles under some conditions.
Yes, you could use three or two boolean variables, but why don't use the fast, old plain goto?
If you want, I can post a piece of code where I used goto.
for( int nITap = 0; nITap < m_nNumPercorsi; nITap++ )
{
// .. blastuff
for( int nJTap = 0; nJTap < m_aPercorsi[nITap].m_nNumTappe - 1; nJTap++ )
{
// ..yet bla stuff
for( nIndAd = 0; nIndAd < m_aNodi[nIndNodCor]->m_nNumNodiAd; nIndAd++ )
if( m_aNodi[nIndNodSuc] == m_aNodi[nIndNodCor]->m_aNodiAdiacenti[nIndAd]->m_pNodoP2D )
break;
for( nICor = 0; nICor < m_aNodi[nIndNodCor]->m_aIndSeg.GetCount(); nICor++ )
{
for( nJCor = 0; nJCor < m_aNodi[nIndNodSuc]->m_aIndSeg.GetCount(); nJCor++ )
{
if( m_aNodi[nIndNodCor]->m_aIndSeg[nICor] == m_aNodi[nIndNodSuc]->m_aIndSeg[nJCor] )
{
nIndSpez = m_aNodi[nIndNodCor]->m_aIndSeg[nICor];
goto L_SegmentoTrovato;
}
}
}
L_SegmentoTrovato:
aTmp.Add( nIndSpez );
I am making a game in Flash CS6 with ActionScript 3.0, and my game can run properly but an error keeps popping up and I can't seem to solve it. The solutions I've found online aren't specific enough to my program.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at farmgame227_fla::MainTimeline/onenter()[farmgame227_fla.MainTimeline::frame2:133]
The line of frame two that is in question will vary depending on how I make the game end. Here are examples of the code in question.
import flash.events.Event;
addEventListener(Event.ENTER_FRAME,onenter);
var myscore = 0;
function onenter(e:Event)
{
if (sheep1.y < 0 || sheep1.y > 775 || sheep1.x < 0 || sheep1.x > 775)
{
removeEventListener(Event.ENTER_FRAME,onenter);
nextFrame();
}
if (hand.hitTestObject (goat))
{
removeEventListener(Event.ENTER_FRAME,onenter);
nextFrame();
}
score.text = myscore;
That isn't all of the code, but I just included the lines that seem to be in question with the debugger.
I have tried searching for multiple solutions to my problem, including debugging, but I can't seem to figure this out.
Thanks in advance.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
I want to know what will be the best way for a char-char conversion.
I will create some data for the conversion for example teh letter "A" will be converted to "C" and so on.
Shall I use a MySQL DB or files or what?
Note: The application will be a web app and most likely be running ASP or PHP.
EDIT:
I want to create a website or a desktop app that will allow user who work on PCs that only support one language to be able to use any other language something like a translator, yet it is not a translator.
For example, arabic users cannot use the AR keyboard due to system restrictions, I want to help them write in the language without installing the language pack. I`m facing this problem myself, and can`t install language pack without admin access.
I can`t provide output at the moment as the PC I`m using doesn`t support AR.
I guess you mean character / keyboard mapping (or an Input Method Editor as Ignacio Vazquez-Abrams said)...
In this case, create static hash maps / associative arrays that map keys to characters or strings.
That said, however, I think there are some keyboard mapping tools out there that hook into the operating system and can be customized to one's needs.
What about JavaScript?
Here's a simple code for converting the infamous YZ keys to ZY (QWERTY <-> QWERTZ).
<textarea id="txt"></textarea>
<script language="JavaScript" type="text/JavaScript">
document.getElementById("txt").onkeydown = InputKeyDown;
function InputKeyDown(event) {
var shift = event.shiftKey;
var keyCode = (event.which == null) ? event.keyCode : event.which;
//alert(String.fromCharCode(keyCode) + "\\n" + keyCode); return false;
switch (keyCode) {
case 89 /* Y */: InsertAtCursor(event.target, shift ? 'Z' : 'z'); return false;
case 90 /* Z */: InsertAtCursor(event.target, shift ? 'Y' : 'y'); return false;
default: return true;
}
}
</script>
I think you could start something with this. You can also use the event.ctrlKey or event.altKey flags for more complex languages.
I want to make the mousewheel up and down send the + and - keys respectively - directly to the OS, as if it came from the keyboard. But only when the Win Key is pressed.
That is the Windows 7 Magnifier uses Win+- and Win++ to zoom in and out, and I want to do that via win-mousewheel, the way it should have worked. Any similar solution will do but would prefer to use the built-in one due to its great multi-monitor support.
I only know VB.NET and C# so in the likely scenario that the solution would be in another language please provide enough that I wouldn't need to learn the language.
Example solution below. It works correctly with Win7 Magnifier, unfortuneatly needs Python 2.5.4, pywin32, pyHook and SendKeys. But it can be rewritten in C/C++ with only a little more effort.
import pythoncom, pyHook, SendKeys
IS_WIN_DOWN = False
def OnMouseEvent(event):
if IS_WIN_DOWN:
if event.Wheel == 1:
SendKeys.SendKeys('{+}')
else:
SendKeys.SendKeys('-')
return True
def OnKeyboardEvent(event):
global IS_WIN_DOWNN
if event.KeyID is 91: #LWIN == 91
if event.Message == 256: #KEY_DOWN == 256
IS_WIN_DOWN= True
elif event.Message == 257: #KEY_UP == 257
IS_WIN_DOWN= False
return True
hm = pyHook.HookManager()
hm.SubscribeMouseWheel(OnMouseEvent)
hm.SubscribeKeyDown(OnKeyboardEvent)
hm.SubscribeKeyUp(OnKeyboardEvent)
hm.HookMouse()
hm.HookKeyboard()
pythoncom.PumpMessages()
Also: old question with a solution in C#
http://www.autohotkey.com/