Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I've stared at this long enough
Message
De
19/03/2007 18:20:10
 
 
À
19/03/2007 17:58:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01205868
Message ID:
01205876
Vues:
17
This message has been marked as the solution to the initial question of the thread.
** I'll reply to my own error by making a notation in the code.

>This is part of an app I wrote. It produces code that I use quite often. However the code it produces in this section has a small bug. Maybe you can help.
>
>Here is the code that is causing the problem.
>
>* Update hidden node netout code creation
>* ERROR IN PART NINE - SOME ENDS OF CODE LINES WILL HAVE '+ ;'  WHERE THEY SHOULD NOT BE.
>* REMOVE THE OFFENDING '+ ;'  - COMPILE AND RUN THE CODE. IT WILL WORK FINE.
>* I AM WORKING ON THIS FINAL GLITCH AND WILL POST THE UPGRADE ASAP
>* Grady McCue  foxunc@telus.net
>***********************************************************************************
>lnhandle = Fcreate("Part9.prg",0)
>dummy = 0
>weightcount = nodecount * 2 + 1
>
>For outsideloop  = 1 To nodecount
>	codeline = [Node] + Transform(nodecount+outsideloop) + [NetOut = ] && Codeline lead is here
>	Fwrite(lnhandle,codeline)
>	Local codeline1
>
>
>
>	For iteration = 1 To nodecount
>		dummy = dummy + 1
>		
>		If dummy < 5 And iteration < (nodecount * 2)
>
>			codeline1 = [(W] + Transform(nodecount+outsideloop) + [_] + Transform(weightcount) + [ * ]  + [Node] + Transform(weightcount) + [Error) + ]
>
>			If weightcount <= nodecount * 3
>				codeline1 = Left(codeline1, Len(codeline1)-3)
>			Endif
>			Fwrite(lnhandle,codeline1)
>
>			If weightcount < (nodecount * 3)
>				Fwrite(lnhandle,"+")
>			Endif
>
>		Endif
>
>		If dummy > 4 And weightcount <= nodecount * 3
>			codeline1 = [(W] + Transform(nodecount+outsideloop) + [_] + Transform(weightcount) + [ * ]  + [Node] + Transform(weightcount) + [Error) +  ;]
>			If iteration = (nodecount * 2)
>				codeline1 = Left(codeline1, Len(codeline1)-3)
>			Endif
>			Fputs(lnhandle,codeline1)
>			dummy = 0
>		Endif
>
>		If weightcount = (nodecount * 3) <<<< should be If weightcount = nodecount
>			codeline1 = Left(codeline1, Len(codeline1)-3)
>		Endif
>		weightcount = weightcount + 1
>
>		If weightcount > (nodecount * 3)
>			Exit
>		Endif
>
>	Next iteration
>	codeline = codeline + " " + codeline1
>	Fputs(lnhandle,"")
>	Fputs(lnhandle,"")
>	weightcount = weightcount - iteration
>Next outsideloop
>
>Here is what part of the output looks like. I can't seem to get the code to drop the final plus sign and semi-colon.
>
>Node93NetOut = (W93_99 * Node99Error)+(W93_100 * Node100Error)+(W93_101 * Node101Error) +  ;
>(W93_102 * Node102Error)+(W93_103 * Node103Error)+(W93_104 * Node104Error)+(W93_105 * Node105Error)+(W93_106 * Node106Error) +  ;
>(W93_107 * Node107Error)+(W93_108 * Node108Error)+(W93_109 * Node109Error)+(W93_110 * Node110Error)+(W93_111 * Node111Error) +  ;
>(W93_112 * Node112Error)+(W93_113 * Node113Error)+(W93_114 * Node114Error)+(W93_115 * Node115Error)+(W93_116 * Node116Error) +  ;
>(W93_117 * Node117Error)+(W93_118 * Node118Error)+(W93_119 * Node119Error)+(W93_120 * Node120Error)+(W93_121 * Node121Error) +  ;
>(W93_122 * Node122Error)+(W93_123 * Node123Error)+(W93_124 * Node124Error)+(W93_125 * Node125Error)+(W93_126 * Node126Error) +  ;
>(W93_127 * Node127Error)+(W93_128 * Node128Error)+(W93_129 * Node129Error)+(W93_130 * Node130Error)+(W93_131 * Node131Error) +  ;
>(W93_132 * Node132Error)+(W93_133 * Node133Error)+(W93_134 * Node134Error)+(W93_135 * Node135Error)+(W93_136 * Node136Error) +  ;
>(W93_137 * Node137Error)+(W93_138 * Node138Error)+(W93_139 * Node139Error)+(W93_140 * Node140Error)+(W93_141 * Node141Error) +  ;
>(W93_142 * Node142Error)+(W93_143 * Node143Error)+(W93_144 * Node144Error)+(W93_145 * Node145Error)+(W93_146 * Node146Error) +  ;
>(W93_147 * Node147Error)
>
>Node94NetOut = (W94_99 * Node99Error)+(W94_100 * Node100Error)+(W94_101 * Node101Error)+(W94_102 * Node102Error) +  ;
>(W94_103 * Node103Error)+(W94_104 * Node104Error)+(W94_105 * Node105Error)+(W94_106 * Node106Error)+(W94_107 * Node107Error) +  ;
>(W94_108 * Node108Error)+(W94_109 * Node109Error)+(W94_110 * Node110Error)+(W94_111 * Node111Error)+(W94_112 * Node112Error) +  ;
>(W94_113 * Node113Error)+(W94_114 * Node114Error)+(W94_115 * Node115Error)+(W94_116 * Node116Error)+(W94_117 * Node117Error) +  ;
>(W94_118 * Node118Error)+(W94_119 * Node119Error)+(W94_120 * Node120Error)+(W94_121 * Node121Error)+(W94_122 * Node122Error) +  ;
>(W94_123 * Node123Error)+(W94_124 * Node124Error)+(W94_125 * Node125Error)+(W94_126 * Node126Error)+(W94_127 * Node127Error) +  ;
>(W94_128 * Node128Error)+(W94_129 * Node129Error)+(W94_130 * Node130Error)+(W94_131 * Node131Error)+(W94_132 * Node132Error) +  ;
>(W94_133 * Node133Error)+(W94_134 * Node134Error)+(W94_135 * Node135Error)+(W94_136 * Node136Error)+(W94_137 * Node137Error) +  ;
>(W94_138 * Node138Error)+(W94_139 * Node139Error)+(W94_140 * Node140Error)+(W94_141 * Node141Error)+(W94_142 * Node142Error) +  ;
>(W94_143 * Node143Error)+(W94_144 * Node144Error)+(W94_145 * Node145Error)+(W94_146 * Node146Error)+(W94_147 * Node147Error) +  ;
>
>As you can see, when each line is equal in length the final characters produced are not dropped. I need to remove the final plus sign and semi-colon from the output.
I ain't skeert of nuttin eh?
Yikes! What was that?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform