返回列表 发布新帖

SCL的赋值运算符确实和LAD的Move的区别

617 0
发表于 2024-7-10 18:16:53 | 查看全部 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
<p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 40); text-align: justify; font-size: 14px; line-height: 26px;">SCL的赋值运算符确实和LAD的Move有区别,</p><p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 40); text-align: justify; font-size: 14px; line-height: 26px;">MOVE更倾向于底层位串的复制,而 := 和算术复制相当,需要考虑数据类型,如果类型不一致,除了隐式转换的情况外需要手工转换数据类型,匹配了才能:=。</p><p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 40); text-align: justify; font-size: 14px; line-height: 26px;">:= 是值赋值,位串表示的Dword的数值显然不等于需要的Real值,如果强行:=,则只会把整数简单转换为浮点数,就像21转换为21.0一样。</p><p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 40); text-align: justify; font-size: 14px; line-height: 26px;">如果打开IEC检查,MOVE也和:=一样需要类型匹配才能Move。</p><p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 40); text-align: justify; font-size: 14px; line-height: 26px;"><br/></p><p><br/></p>

回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright © 2001-2025 英威腾技术论坛 版权所有 All Rights Reserved. 粤ICP备07504406号
关灯 在本版发帖
扫一扫添加微信客服
返回顶部
快速回复 返回顶部 返回列表