HSP¥Ý¡¼¥¿¥ë
¥µ¥¤¥È¥Þ¥Ã¥× ¤ªÌ䤤¹ç¤ï¤»


HSPTV!·Ç¼¨ÈÄ


̤²ò·è ²ò·è Ää»ß ºï½üÍ×ÀÁ

2021
0703
kenNullʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¥Æ¥­¥¹¥È¤«¤éNullʸ»ú¤òºï½ü¤¹¤ë¤Ë¤Ï4²ò·è


ken

¥ê¥ó¥¯

2021/7/3(Sat) 16:26:05|NO.93148

²ñ¼Ò¤Î²ñ·×¥½¥Õ¥È¤«¤é¥Ç¡¼¥¿¤òcsv·Á¼°¤Ç½ÐÎϤµ¤»¤Æ¡¢¤½¤Î¥Ç¡¼¥¿¤ò½èÍý¤¹¤ëÌÜŪ¤Ç¡¢
HSP¤Ç¥¹¥¯¥ê¥×¥È¤ò½ñ¤¤¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬¡¢notesel¤ò»È¤Ã¤ÆÆɤ߹þ¤à¤È¤É¤¦¤·¤Æ¤â¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î
ÆÃÄê¤Î¤È¤³¤í¤ÇÀÚ¤ì¤Æ¤·¤Þ¤¦¤Î¤Ç¡¢csv¥Õ¥¡¥¤¥ë¤òÄ´¤Ù¤Æ¤ß¤ë¤È¡¢Nullʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤¬
¸¶°ø¤À¤È¤ï¤«¤ê¤Þ¤·¤¿¡£¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤È¤·¤ÆÆɹþ¤á¤Ð¤è¤¤¤È»×¤¦¤Î¤Ç¤¹¤¬¡¢¤½¤Î¸å¤Î½èÍý¤ò¥Æ¥­¥¹¥È
¥Ç¡¼¥¿¤È¤·¤Æ°·¤¦¤Ë¤Ï·ë¶ÉNullʸ»ú¤òºï½ü¤¹¤ëɬÍפ¬¡¦¡¦¡¦¡£¤½¤â¤½¤â¥Æ¥­¥¹¥È¤È¤·¤Æ°·¤¨¤Ê¤¤¤Î¤Ç
strrep¤ästrtrim¤ò»È¤¦¤³¤È¤â½ÐÍ褺¹Ô¤­µÍ¤Ã¤Æ¤¤¤Þ¤¹¡£
¤É¤Î¤è¤¦¤ÊÊýË¡¤¬¤¢¤ë¤Î¤«¶µ¤¨¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©



¤³¤Îµ­»ö¤ËÊÖ¿®¤¹¤ë


¤Õ¤Ë¤¯¤é

¥ê¥ó¥¯

2021/7/3(Sat) 16:46:47|NO.93149

NULLʸ»ú¤Î°ÌÃ֤ʤéstrlen¤Çʬ¤«¤ê¤Þ¤»¤ó¤«¡©
­¡¤Þ¤ºexist¤Ç¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ò¼èÆÀ¡¢¥Ð¥¤¥Ê¥ê¤È¤·¤Æsdim¤Ëbload
­¢¼¡¤Ëstrlen¤ÇNULL¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¼èÆÀ¤·¡¢
­£­¢¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ëpoke¤ÇȾ³Ñ¥¹¥Ú¡¼¥¹(0x20)¤«²¿¤«Å¬Åö¤ÊÂå¤ï¤ê¤Îʸ»ú¤ò½ñ¤­¹þ¤à

­¢¡Á­£¤òstrlen==¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ë¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤¹¡£
¤³¤ó¤ÊÊýË¡¤Ç¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£

»î¤·¤Æ¤Ê¤¤¤Î¤Ç¥¢¥ì¤Ç¤¹¤¬¡¢²¾¤Ëstrlen¤¬¥À¥á¤Ç¤âCɸ½à´Ø¿ô¤Îstrchr¤È¤«¤Ç¹Ô¤±¤ë¤«¤È¡£
»È¤¤Êý¤Ï¥°¥°¤ì¤Ð½Ð¤Æ¤­¤Þ¤¹¤è¡£
#uselib "msvcrt"
#cfunc global strchr "strchr" var,int



GENKI

¥ê¥ó¥¯

2021/7/3(Sat) 19:43:50|NO.93150

nullʸ»ú¤ò¤É¤Î¤è¤¦¤Ê°ÕÌ£¤Î¥Ç¡¼¥¿¤È¤·¤Æ°·¤¦¤«¤Ë¤è¤Ã¤ÆÂнèË¡¤¬ÊѤï¤Ã¤Æ¤¯¤ë¤È»×¤¤¤Þ¤¹¡£

¤È¤ê¤¢¤¨¤ºÌµ»ë¤¹¤ë¥Ç¡¼¥¿¤È¤·¤Æ¹Í¤¨¤Æ¤ß¤Þ¤·¤¿¡£
bload¤Ç¤â¤¤¤¤¤Ç¤¹¤¬¡¢noteload¤ÇÆɤ߹þ¤ó¤À¸å¤Ënullʸ»ú¤òÌäÂê¤Ê¤¤Ê¸»ú¤ËÃÖ¤­´¹¤¨¤ë¤·¤«¤Ê¤¤¤ó¤¸¤ã¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

; ¸µ¤Îʸ»úÎó sdim a a = "abcdef" mes a l = strlen(a) ; nullʸ»úº®Æþ poke a, 3, 0 mes a ; nullʸ»ú¤ò¼è¤ê½ü¤¯ repeat l if peek(a, cnt) = 0 { poke a, cnt, ' ' ; ¥¹¥Ú¡¼¥¹¤ËÃÖ¤­´¹¤¨ } loop mes a
nullʸ»ú¤ÎÉôʬ¤òºï½ü¤·¤¿¤¤¾ì¹ç¤âƱ¤¸¤è¤¦¤ËÁ´Ê¸»ú¥ë¡¼¥×¤Çõ¤·¤Æ¡¢Â¾¤ÎÊÑ¿ô¤Ë°Ü¤·Âؤ¨¤ë¤È¤¤¤¦¼ê½ç¤Ë¤Ê¤ê¤Þ¤¹¡£



¤È¤¢¤ë¥×¥í¥°¥é¥Þ

¥ê¥ó¥¯

2021/7/3(Sat) 20:30:07|NO.93151

¥â¥¸¥å¡¼¥ë¤È¤·¤Æºî¤Ã¤Æ¤ß¤Þ¤·¤¿¡£

»ä¤Î¥¹¥¯¥ê¥×¥È¤Î¾ì¹ç¤Ï¥Ì¥ëʸ»ú¤òºï½ü¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¢¤ê¤Þ¤¹¡£
ʸ»ú¥³¡¼¥É¤ÏShift-JIS¤Î¤ß¤Ç¡¢Unicode¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Þ¤»¤ó¡£

¥Õ¥¡¥¤¥ë¤Ç¤Ï»î¤·¤Æ¤¤¤Þ¤»¤ó¤¬¡¢bload¤Ç¤âÂбþ¤·¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£


#module // ·¿¤ò var ¤Ç¤Ï¤Ê¤¯ str ¤Ë¤¹¤ë¤È¥Ì¥ëʸ»ú°Ê¹ß¤¬ÀÚ¤êÍî¤È¤µ¤ì¤ë¤Î¤ÇÃí°Õ #deffunc RemoveNullChar var text, \ local index, local merged // ¢¬ºÆµ¢¤¹¤ë¤Î¤Ç¥í¡¼¥«¥ëÊÑ¿ô¤Ç¤¢¤ë¤³¤È // ¥Ì¥ëʸ»ú¤Î¼¡¤Îʸ»ú¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ index = strlen(text) + 1 repeat if (index == varsize(text)) : break if (peek(text, index) == 0) : index++ : else : break //2ʸ»ú°Ê¾å¤Î¥Ì¥ëʸ»ú¤ÎϢ³¤ò¸¡ÃÎ loop // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¥Ì¥ëʸ»ú¤¬Ï¢Â³¤·¤Æ¤¤¤ì¤Ð¡¢ºÇ¸å¤Î¥Ì¥ëʸ»ú + 1 ¤ò»Ø¤¹¡£ // ¨¤Á ¥¤¥ó¥Ç¥Ã¥¯¥¹¡áÊÑ¿ô¥µ¥¤¥º ¤Ç¤¢¤ì¤Ð½ªÃ¼°Ê³°¤Ë¥Ì¥ëʸ»ú¤¬Ìµ¤¤¤³¤È¤ò¼¨¤¹ if (index == varsize(text)) : return // ÊÑ¿ô½é´ü²½ sdim merged, strlen(text) + (varsize(text) - index) // ¥Ì¥ëʸ»ú¤Þ¤Ç¤Îʸ»ú¿ô + (Á´Âοô - ¥Ì¥ëʸ»ú¤Î¼¡¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹): ¨¤Á»Ä¤ê¤Îʸ»ú¿ô // ÊÑ¿ô¤ËÆâÍƤò¥á¥â¥ê¥³¥Ô¡¼ (ÉáÄ̤Υ¤¥³¡¼¥ëÂåÆþ¤äʸ»úÎó´ØÏ¢¤ÎÌ¿Îá¤À¤È¡¢¥Ì¥ëʸ»ú°Ê¹ß¤¬ÀÚ¤êÍî¤È¤µ¤ì¤Æ¤·¤Þ¤¦) memcpy merged, text, strlen(text) // ¥Ì¥ëʸ»ú¤Þ¤Ç¤ò¥³¥Ô¡¼ memcpy merged, text, varsize(text) - index, strlen(text), index // ¥Ì¥ëʸ»ú°Ê¹ß¤ò¥³¥Ô¡¼ // ¥Ì¥ëʸ»ú¤Î¼¡¤Îʸ»ú¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ÊÑ¿ô¥µ¥¤¥º¤ËËþ¤¿¤Ê¤±¤ì¤Ð»Ä¤ê¤¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ê¤Î¤ÇºÆµ¢½èÍý¤ò¹Ô¤¦ if (index < varsize(text)) : RemoveNullChar merged // ¤³¤Î»þÅÀ¤Ç½ªÃ¼°Ê³°¤Î¥Ì¥ëʸ»ú¤Ïºï½ü¤µ¤ì¤Æ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ sdim text, strlen(merged) text = merged return #global text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ¤¢¤¤¤¦¤¨¤ª¤«¤­¤¯¤±¤³0123456789" poke text, 5, 0 // F ¤òNULLʸ»ú¤Ë poke text, 6, 0 // G ¤òNULLʸ»ú¤Ë poke text, 15, 0 // P ¤òNULLʸ»ú¤Ë wpoke text, 31, 0 // ¤¦ ¤òNULLʸ»ú¤Ë (ÆüËܸì¤Ï2¥Ð¥¤¥È) mes "ÊÑ´¹Á°" mes text mes RemoveNullChar text mes "ÊÑ´¹¸å" mes text



ken

¥ê¥ó¥¯

2021/7/4(Sun) 08:42:17|NO.93152

¤Õ¤Ë¤¯¤é¤µ¤ó¡¢GENKI¤µ¤ó¡¢¤È¤¢¤ë¥×¥í¥°¥é¥Þ¤µ¤ó¤´¶µ¼ø¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¤Õ¤Ë¤¯¤é¤µ¤ó¡¢GENKI¤µ¤ó
Nullʸ»ú¤ò¾¤Îʸ»ú¤ËÃÖ´¹¤·¤Æ¡¢¤½¤Î¸åºï½ü¤¹¤ë¤È¤¤¤¦ÊýË¡¤¬¤¢¤Ã¤¿¤Î¤Ç¤¹¤Í¡¢»ä¤ÏľÀܼè¤ê½ü¤³¤¦¤È¹Í¤¨¡¢¤È¤¢¤ë¥×¥í¥°¥é¥Þ¤µ¤ó¤Î¤è¤¦¤ËNullʸ»ú¤Þ¤Ç¤òÊÌÊÑ¿ôa¤ËÂåÆþ¤·¡¢Nullʸ»ú¤Î¼¡¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹
°Ê¹ß¤Îʸ»úÎó¤òÊÌÊÑ¿ôb¤Ë¥³¥Ô¡¼¤·¤½¤ì¤òÊÑ¿ôa¤ËÄɵ­¤¹¤ë¤È¤¤¤¦Áàºî¤ò·«¤êÊÖ¤¹¤³¤È¤ÇNullʸ»ú¤ò¼è¤ê½ü¤³¤¦¤È¤·¤Æ¤¤¤Þ¤·¤¿¡£
¤Ç¤â¡¢ÊÑ¿ôb¤Ëʸ»úÎ󤬥³¥Ô¡¼¤µ¤ì¤º¾å¼ê¤¯¤¤¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£
¤È¤¢¤ë¥×¥í¥°¥é¥Þ¤µ¤ó¤Î¥â¥¸¥å¡¼¥ë¤òÇÒ¸«¤µ¤»¤Æ¤¤¤¿¤À¤­¸¶°ø¤¬²ò¤ê¤Þ¤·¤¿¡£
»ä¡¢ÊÑ¿ô¤òÂåÆþ¤¹¤ëºÝ¤Ë = ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤·¤¿¡£= ¤ÎÆÃÀ­¤òÍý²ò¤·¤Æ¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
Nullʸ»ú¤òÊÌʸ»ú¤ËÊÑ´¹¤¹¤ëÊýË¡¤ò¤À¤È¤Ä¤Þ¤º¤¤¤Æ¤¤¤Ê¤«¤Ã¤¿¤è¤¦¤Ë»×¤¤¤Þ¤·¤¿¡£

¤È¤¢¤ë¥×¥í¥°¥é¥Þ¤µ¤ó¥â¥¸¥å¡¼¥ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
varsize¤ämemcpy¤Î¸ºß¤ÏÃΤäƤ¤¤Þ¤·¤¿¤¬¡¢¤É¤Î¤è¤¦¤Ê¾ì¹ç¤Ë»ÈÍѤ¹¤ë¤Î¤«Ê¬¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
ƱÍͤμê½ç¤ò¹Í¤¨¤Æ¤¤¤¿¤Î¤Ç¤¹¤¬¡¢¤³¤Î¤è¤¦¤Ë¤¹¤Ã¤­¤ê¤·¤¿¥¹¥¯¥ê¥×¥È¤Ë¤Ê¤ë¤ó¤À¤È¶Ã¤­¤Þ¤·¤¿¡£
¼ÂºÝ¤Îcsv¥Õ¥¡¥¤¥ë¤Ç»î¤·¤Þ¤·¤¿¡£¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬Â礭¤¤¤Î¤Ç¡¢Â¿¾¯»þ´Ö¤¬¤«¤«¤ë½èÍý¤Ë¤Ï¤Ê¤ê¤Þ¤¹¤¬¡¢³Î¼Â¤ËNull¤Ïºï½ü¤Ç¤­¤Þ¤·¤¿¡£

¤Õ¤Ë¤¯¤é¤µ¤ó¡¢GENKI¤µ¤ó¡¢¤È¤¢¤ë¥×¥í¥°¥é¥Þ¤µ¤ó
ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£



ONION software Copyright 1997-2023(c) All rights reserved.